How to amend issue to sub task and set parent using Jira automation

Daniel Newman January 15, 2021

Hi,

I am trying to use Jira automation to amend the issue type of an issue from a standard issue type to a sub task. When doing this I need to be able to set the parent of the sub task so that is correctly linked to the relevant parent task.

I have created an automation rule that triggers when an issue is created with a specific issue type. I am then creating a variable by using the issue.summary and then splitting on a space to use the first part of the summary which will be in the format "SD-123 - title" where SD-123 is the Jira issue key of the parent task I want to link the sub task to. This will give me a variable named Parent that will contain "SD-123" for example.

CreateVariable.PNGI am then using the "Edit Issue" action to edit the issue type to a sub task and then trying to set the parent using the additional field JSON shown below, which uses the variable created above:

EditIssue.PNG

When the automation rule is triggered it completes successfully, without any issues, amending the issue to a sub task as required but the sub tasks parent doesn't appear and the sub task ends up without a parent. 

Is there something I am missing when setting the parent in the additional field JSON shown above or is it not possible to set the parent of a sub task in this way and therefore my required outcome not achievable?

Any help with this would be appreciated.

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
January 15, 2021

Hi @Daniel Newman 

For some context, would you please post an image of your entire rule?  Thanks!

Is this for a classic or a NextGen project?

Next, if you log the {{Parent}} to the audit log, what do you see?

Best regards,

Bill

Daniel Newman January 18, 2021

Hi @Bill Sheboy 

Thanks for your response.

Please see image below of entire rule with the logging shown in the audit log.

I can confirm this is a classic project.

EntireAutomationRule.png

Kind Regards

Dan

Bill Sheboy
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.
January 19, 2021

Thanks, Dan.

If you are trying to edit the parent for a sub-task, it does not appear to be possible yet.  I found that looking at the advanced JSON help and using a REST API call to gather the editmeta data for a sub-task.

https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-editmeta-get

Daniel Newman January 21, 2021

Hi @Bill Sheboy ,

Thanks for your response. 

Could you please just confirm that I am understanding you correctly?

I think what you are saying is that this is not currently possible via either Jira automation or the Rest API at this moment in time?

I have found the following request on Jira Server which I presume would resolve my problem if the same was done on Jira Cloud:

https://jira.atlassian.com/browse/JRASERVER-68763

Thanks again for your help.

Bill Sheboy
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.
January 21, 2021

Hi, Dan.  Correct; it does not appear to be possible yet.

The suggestion you noted is for Jira Server, and I did not find a corresponding one for Cloud.  You may add that suggestion in that same backlog by selecting Create at the top of the page.  I recommend then adding a comment to link the two items (or put it in the description) to help Atlassian see both items.

Thanks,

Bill

Daniel Newman January 21, 2021

Thanks Bill

Daniel Newman January 22, 2021

Jira Cloud suggestion raised as follows:

https://jira.atlassian.com/browse/JRACLOUD-75890

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events