Condition depending on Parent Issue Customfield Value

Hi!

 

I would like to add a condition on a sub-task transition button to be activated only a customfield of the parentissue have a specific value.

ex: if the customfield 'City' = 'Atlanta' in my parentissue, i want the transition button of the sub-task to be activated.

thanks in advance for your help!

1 answer

1 accepted

This widget could not be displayed.

You could do this if you were to add Scriptrunner to JIRA.  Natively JIRA can't create this kind of workflow condition.  But with scriptrunner, you can create a workflow condition called "Script Condition".  Selecting that option then provides a couple of different ways you could go about creating this condition.  The more complex methods are to use either a Custom script or simple script condition.

But in my case, I was able to use the "Allow the transition if this query matches a JQL query"   Since ScriptRunner adds a bunch of additional JQL functions, we can actually use those here to find this information.   Your query might looks something like this:

issueFunction in subtasksOf("City=Atlanta")

This JQL query only returns issues that are subtasks where the parent issue has a value of "Atlanta" for the field "City".

Oh, also I should note, I created a separate workflow for my subtask issue type to follow in my project.   Not sure if you were planning to do this, but this makes it easier to make sure this condition only gets applied to that workflow that only controls those specific issue types.  Otherwise if you're using the same workflow for your subtasks as other issue types, this condition could theoretically prevent issues without a parent issue from transitioning here.

it worked like a charm (with Script Runner)

 

Thank you very much for your time!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

575 views 25 15
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you