ScriptRunner Transition Parent Issue Question

Jordan Artman January 4, 2021

I have a sub-task that is triggered off of a sub-task workflow. Once this sub-task is moved to Done, I would like the post-function to transition the main parent ticket to done. 

It looks like this:

New Item Request -> Triggers Item Set-up sub-task -> Triggers Attribution Sub-task - >Triggers Item Audit sub-task

When Item Audit moves to done, I would like the New Item Request parent ticket to move to Done. I tried to use the built-in auto transition parent issue script but it failed (im thinking this is because it was trying to move Attribution to done?)

Please advise!

Thanks,

Jordan

3 answers

0 votes
Daniel Ebers
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 6, 2021

Hi @Jordan Artman

the screenshot you have posted looks like it is from Script Runner. Just for a clarification: are you going the Script Runner route or do you use Jira Automation?

Did I understand it correctly the hierarchy is as follows?

New Item Request ("Main-"Issue)
  |----> Item Set-up (Sub-Task)
  |----> Attribution (Sub-Task)
  |----> Item Audit (Sub-Task)

In case Item Audit transitions to "Done" the "New Item Request" is moved to done. Is this correct?
But what will happen with the status of "Attribution" and "Item Set-up" Sub-Task? There is a possibility in this scenario that they will be left with "Open" status and overseen (probably) because the "Main-"Issue is already in "Done" status.
Am I missing a point?

Regards,
Daniel

Jordan Artman January 6, 2021

Hi Daniel,

Thanks for your response! The Attribution won't trigger until Item Setup moves to "Done" and Item Audit won't trigger until Attribution moves to "Done". So all sub-tasks would be done by the time item audit is complete, but the issue is the parent ticket stays open when Item Audit moves to done. It is scriptrunner. Hope this helps to clarify & I really appreciate your support!

Daniel Ebers
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 6, 2021

Hi Jordan,

I am positive this can be achieved using Script Runner along with the Built-in Script "Transition parent when all sub tasks are resolved" it provides:
https://scriptrunner-docs.connect.adaptavist.com/jiracloud/post-functions.html#_transition_parent_issue
Edit: linked the appropriate documentation for Cloud, the previous one was for Server.

The description sounds promising and I believe to remember having implemented this a few years back.

From the description it seems to be a match:

Put this post-function on the sub-task workflow on transitions where the workflow could be set, typically Resolve Issue. If all sibling sub-tasks are resolved this will transition the parent issue using the provided action, which should be valid for the current step. If it’s not valid, nothing will happen.

Could you please check if this is what you are looking for and if so, if it works?

Regards,
Daniel

0 votes
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2021

@Jordan Artman -

Hi Jordan:

You will need to ensure that Parent issue's WF status has a path to be moved into "Done" status.  Otherwise, you will not be able to triggered the parent issue's status to "Done" via automation or ScriptRunner post function codes.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc

0 votes
Bastian Stehmann
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2021

Hi @Jordan Artman ,

Welcome to the community. 

I think you can try it like in the build in automation. You just have to find the parent issue before and do the transition on that issue.

Jordan Artman January 5, 2021

Hi @Bastian Stehmann

 

Thank you so much for your quick reply! Do you have a code to get the parent? The built in automation looks like this:

transition parent.PNG

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