Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

REST API command, add today's date in subject line.

Gregory Hicks October 19, 2015

Right now I have a Curl command that creates a sub-task in JIRA called Backup Restore. What I am trying to find is the command that will add today's date before the subject name.

Example: 2015-10-19 Backup Restore

I tried some linux commands like date +%Y-%m-%d but that doesn't seem to work. Below is the command I am using.

curl -D- -u UserName:Password -X POST --data "{\"fields\":{\"project\":{\"key\":\"TCHP\"},\"parent\":{\"key\":\"TCHP-1\"},\"summary\":\"Backup Restore\",\"description\":\"Don't forget to do this too.\",\"issuetype\":{\"id\":\"5\"}}}" -H "Content-Type: application/json" https://myjiraURL.com/rest/api/latest/issue/

Thanks for the help,

Greg

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 19, 2015

Why don't you write it as a bash script? I am sure that would work as you can add a variable for the summary that has the date pre-pendend and use that.

0 votes
Gregory Hicks October 21, 2015

Currently the curl command is setup in a bash script but I am not sure where to place to date command in the script. I am trying to use $ date +"%m-%d-%y" but where ever I put it the script stops working.



Gregory Hicks October 21, 2015

Ah, got it! I used this. "summary\":\"$(date +"%m-%d-%Y") Backup and Restore\"

TAGS
AUG Leaders

Atlassian Community Events