Forums

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

{{#changelog.parent}}{{fromString}}{{/}} and {{issue.parent.key}} give the same results for subtask

Oksana Baier January 31, 2023

I've been working on a rule in Jira for a very long time that updates the estimation counter for the old and new parent when the ticket changes parent (for Epic or for Story)

All works correctly 
But today I have problem


In rule trigger - update of ticket

After that we need to check conditions

Go run case when sub-task change Story parent

Condition is match: it is sub-task and parent = story

After that I try to know ID of new parent by {{issue.parent.key}} 

 

1.png

and previous parent by {{#changelog.parent}}{{fromString}}{{/}}

3.png

A week ago {{issue.parent.key}} return the value of the current parent
Now it returns the value of the previous parent like operation  {{#changelog.parent}}{{fromString}}{{/}}

1) Is it okey? 

I try to check smart value and create new manual rule for manual trigger for checking this smart value separate for sub-task

1.png

2.png

But in this rule - {{issue.parent.key}} return me current Story parent and {{#changelog.parent}}{{fromString}}{{/}} doesn't work 

I dont understand what happen and why in first rule it work incorrectly and in secod rule part of this works, but other part doesn't work

2 answers

1 accepted

1 vote
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 31, 2023

Hi @Oksana Baier 

The symptom you describe seems to indicate a timing problem, where

  • multiple things are changing for the issue,
  • the first thing changing is not the parent, and so
  • the change log contains the "current value"...
  • until the rule triggers again.

Two things to check if this is the cause are posting the details of the audit log to see if there are multiple rule triggerings for a parent change, and...consider the steps/order of steps which lead to the reassignment of parent.

Kind regards,
Bill

Oksana Baier February 3, 2023

Thanks!

0 votes
Trudy Claspill
Community Champion
January 31, 2023

Hello @Oksana Baier 

Regarding why changelog doesn't work in the rule you manually trigger, that is because changelog values are available only when your rule uses the Issue Updated trigger. When you manually trigger a rule, there is no update occurring in the issue so there is not changelog to review.

I'll have to do some experimentation regarding the issue you are seeing with the parent key being returned.

Trudy Claspill
Community Champion
January 31, 2023

In my experimentation I am not seeing {{issue.parent.key}} returning the previous parent key value.

My experiment was very simple. 

Screen Shot 2023-01-31 at 3.51.59 PM.png

The only change I made to the subtask was to move it from one parent issue to another.

Because your rule is using the Issue Updated trigger, it may be getting triggered for changes to subtasks other than the change of the parent. In that case you may not get the results you expect because the changelog will not have an entry for fromString for the parent field.

In the scenario where some other change was made to the subtask, then issue.parent.key still returned the current parent, and changelog.parent returned nothing.

Can you provide the details of the Rule Audit Log in a scenario where the rule was triggered and issue.parent.key returned the key for the subtask's previous parent?

Like # people like this

Suggest an answer

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

Atlassian Community Events