I am trying to create issue using REST API with curl command which is
curl -d "@issue.json" -H "Content-Type: application/json" -X POST -u username:password https://jirasd.mycompany.com/rest/api/2/issue/ | python3 -m json.tool
Curl commands executes successfully and the new issue creates in project but when i am trying to execute cronjob for every minute with this command is not working as expected i tried below workflows
$ crontab -e
$ * * * * * curl -d "@issue.json" -H "Content-Type: application/json" -X POST -u username:password https://jirasd.mycompany.com/rest/api/2/issue/ | python3 -m json.tool
After saving no response at all. Please guide me if i am giving wrong formats in crontab?
I even tried commading like
* * * * * /home/desktop/test.sh still not working
* * * * * /home/desktop/test.sh >> /tmp/test.json It throws me an error of {"errorMessages":["No content to map to Object due to end of input"]}
Please help me to fix this issue.
Regards,
CN
Not necessarily specific to jira but more to cron usage. (and forgive me if i am going over things you may already know)
Cron will not run in the same user environment as an interactive shell. Check to see if there are things you are assuming (paths, etc) that may not be true when run from cron. Assume nothing. (like the path to your data file)
If you use selinux, check that it is not getting in the way. Temporarily set to "permissive" and see if it works. (you dont want to know how many hours I have spent debugging a problem only to realize that selinux was blocking me.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.