Is there combined smart values as {{issue.parent.subtask.status}}

Viktoria Boiko December 13, 2022

Hello everyone
I try to create an automation rule that will be executed from sub-tasks and linked issues of parent task and it will be check if parent issue has all sub-tasks in Done status and linked issues in Closed status and if yes, then move parent task to Resolve status. Is it possible to create such rule with automation?
Now I'm triyng to refer to sub-tasks of parent issue through the sub-task that was moved to Done status to check their statuses and I'm trying to use something like {{issue.parent.subtask.status}}, but it's not working. Maybe there is some other way to achive my goal?

2 answers

1 accepted

0 votes
Answer accepted
Viktoria Boiko December 29, 2022

Eventually I did it with automation. Everything turned out to be much, much easier.
This video helped me: https://www.youtube.com/watch?v=itZtQXGCSoM&ab_channel=AutomationforJira

Solution:

 image (51).pngimage (52).png

2 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.
December 13, 2022

Hi @Viktoria Boiko 

First thing, I am using Jira Cloud, not the Server/Data Center version, and so my suggestion is based on the documentation.

Unfortunately, Server/Data Center does not have the Lookup Issues action in rules, which would make this use case easy.

As a possible work-around, you could try using JQL and the bulk-handling feature of Server/Data Center rules with a branch to check the condition.  For example...

  • Create some JQL for the opposite of your conditions, looking for any sibling subtasks (of the trigger issue) which are not Done.  And create another JQL for any linked issues of the trigger subtask which are not Closed.  Let's call these query #1 and #2, respectively.
  • Now combine those with an OR operator: (query #1) OR (query #2)
  • Use that in your branch with bulk handling, and add an advanced compare condition
    • first value: {{issues.size|0}}
    • condition: equals
    • second value: 0
  • if that condition passed, there were no issues preventing moving the parent to done

 

Kind regards,
Bill

Viktoria Boiko December 13, 2022

Hello Bil, this is a brilliant idea but I see now that "lookup" function is neccesary here.
First of all, I modified "(query #1) OR (query #2)" JQL with adding key of the parent issue here, because this issue have to match JQL condition to execute.
Second, сonsidering the previous modification I changed {{issues.size}} equals to 1, not 0 because now we will get parent issue in our search anyway.
And the next issue I faced is that {{issues.size}} (and {{lookupissues.size}} too) always return 1 no matter how much issues in the JQL results I have - this is the main problem to achive the goal now.

rule_1.png

rule_2.png

Viktoria Boiko December 13, 2022

But your idea is good anyway, maybe I can achive this the same way but with Scriptrunner. I will try and let you know how it turns out. Thank you.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer