JIRA REST API-don't create subtask if already exists-SOLVED

Dragan Vucanovic March 6, 2018

I have a script to create subtasks, but is it possible not to create subtask if it already exists

2 answers

1 accepted

0 votes
Answer accepted
Dragan Vucanovic March 7, 2018
0 votes
Steven Behnke
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.
March 6, 2018

Why would you ask this on the dev forum and the user form?

Just use the query api to see if the issue you want to create is already there.

Dragan Vucanovic March 6, 2018

issue is there, but i don't want to return issue if subtask already exists, this one returns issues with and without subtasks

 

curl -XN -u user:pass -X GET -H "Content-Type: application/json" https://jira.corp.com/rest/api/2/search?jql=project='"Technology"+AND+summary~"Disable%20User*"+AND+status!="DONE"+AND+issuetype!="Sub-Task"' | python -m json.tool > 1.json

 

Suggest an answer

Log in or Sign up to answer