Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation for jira, unable to change parent of sub-task (team managed)

Jeffrey Bistrong
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.
June 6, 2023

According to my reading here (https://jira.atlassian.com/browse/JSWCLOUD-22718)

 

I should be able to update the parent of a sub-task in automation for jira. I don't see the parent option in the fields drop down, but when I try to configure it via advanced editing I am unable to do so. The rule does not error out but it does not update the parent either

The below does not error out, but it does not update the parent

Monosnap Demo Support - Details - JIRA 2023-06-06 15-01-00.png

The below errors out

 

{
"fields": {
"parent": ["{{triggerissue.key}}"]
}

}

 

(I've also tried "parent.key" and automation won't even let me save the rule)

 

Monosnap Demo Support - Details - JIRA 2023-06-06 15-02-20.png

I am able to successfully do this in company managed projects

Monosnap Automation - JIRA 2023-06-06 15-03-08.png

 

2 answers

1 accepted

1 vote
Answer accepted
Jeffrey Bistrong
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.
June 6, 2023

I got it to work using the following JSON

 

{

"fields": {
"customfield_10500": "{{triggerIssue}}"

}
}

I found the parent link custom field value in the JSON for the issue

Monosnap rightsline.atlassian.net_rest_api_2_issue_DEMO-112_expand=names 2023-06-06 18-19-45.png

0 votes
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.
June 6, 2023

Hi @Jeffrey Bistrong 

I see a few things in your rules to adjust that might help...

First, smart values are name, spacing, and case sensitive, and the one for the trigger issue is:

{{triggerIssue}}

Next, when you are setting a parent with JSON, that should be only one value, not an array of values.  Perhaps try this:

{
"fields": {
"parent": "{{triggerIssue.key}}"
}
}

Finally, I notice that you appear to be creating a variable {{NewTask}} in one branch and then using it in another.  That will not work because the variable will go out of scope, and so become null.  Without seeing your complete rule I cannot offer alternative rule structures.

Kind regards,
Bill

Jeffrey Bistrong
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.
June 6, 2023

Thank you, the screen shot with {{NewTask}} is actually a sample from a different automation rule where everything works OK, and I can create a variable in one branch and use it in another (tested and it works).

 

However. I have updated the problematic automation rule per your suggestion and no dice. Here are screen shots from my entire automation rule as well as the error.

 

{

"fields": {
"parent": "{{triggerIssue.key}}"

}
}

Monosnap Demo Support - Details - JIRA 2023-06-06 18-03-16.png

Monosnap Demo Support - Details - JIRA 2023-06-06 18-01-57.pngMonosnap Demo Support - Details - JIRA 2023-06-06 18-02-14.png

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.
June 7, 2023

Thanks, @Jeffrey Bistrong and I recommend confirming your created variable and branching works as you expect in that other rule...

Branches on more than one issue/thing processes separately, and asynchronously, from the rest of the rule.  There is no guarantee of when such a branch will complete...up to the last step of the rule.

What this means is that if you are setting a variable inside of a branch, two things happen:

  • the variable is re-created over and over as new, each time a branch item processes, and then goes out of scope afterwards and disappears (the exception is branches which can only process one thing, such as on epic parent)
  • there is no guarantee the variable will be available to any steps after the branch at a predictable timeframe
Like Trudy Claspill likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events