Hi Mark Waite,
Thanks for your response on that.
Firstly, I have take into consideration all of the things that you stated except the environment. My local Macos Terminal which is linux, but i am running my script in on Ubuntu which makes a little sense for a moment but in that case the build should fail and in the logs i am seeing only one ticket number extracted every time.
And i am using commands like:
sed, regular expresions, echo, sort, uniq, for loop and curl too.
And also running through Cron Job is also a good idea but i have to include this script only in the job which deploys our code to STG Env. Cron Job is what we can schedule to run this at that particular time. But here the requirement is different, script should execute along with the code deploy job.
Is there any other alternative that i can proceed by excluding these consequences .