JIRA Rest API- don't create subtask if already exists

I’m using curl command to create subtasks, but is it possible not to duplicate subtask if it already exists ?

How do you know if its duplicate? Just check and see if it already exists in a query.

Well - it depends on how you define a duplicate subtask? Is it just the summary text, combination of summary text & issue type, summary text & issue type & assignee (I can go on for a bit here).

Since everyone’s definition of a duplicate will be different - the best way would be to check the current subtasks on an issue. Take a look at https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue/{issueIdOrKey}/subtask-getSubTasks . ( I would give you the Jira Cloud Rest reference - but I can’t handle the navigating through that api - but the cloud url should be the same).

1 Like