Transition post-function for a Sub-Task

Sadath Ali Syed June 11, 2021

We have a requirement where a sub-task of current issue should be transitioned. If a new sub-task is opened in the current issue with same EmpID, we want to close/transition the existing sub-task with same EmpID. We tried few JMWE post-funtions with no luck. We currently have JMWE, JSU and Project automation available. Any help with this issue will be highly appreciated.

2 answers

1 accepted

1 vote
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2021

Hi @Sadath Ali Syed 

you can achieve this using JMWE. On the Create transition of your sub-task workflow, you should add a Transition Related Issues post-function, configured as follows:

  • Transition(s): the Close transition to trigger on the other sub-task
  • Target Issue(s): "Issues returned by the following Groovy script:"
  • Groovy Script:
issue.parentObject?.subTaskObjects?.findAll{issue != it && it.get("EmpID") == issue.get("EmpID")}
Sadath Ali Syed June 12, 2021

Thanks @David Fischer . JMWE rocks!

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2021

Hello @Sadath Ali Syed 

What is "EmpID"? Is that a custom field? If so, what type of field is it?

I think it might be possible to do this with Automation, but to work out the details I need to know what EmpID is.

Sadath Ali Syed June 11, 2021

@Trudy Claspill EmpID is a custom field of type 'Text Field (single line)'

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2021

What type of data is entered in the field? Are spaces or non-alphanumeric characters ever included?

What version of Jira are you using and what version of Automation?

I work with Jira Cloud. I might be able to work out a solution in Automation there, but that doesn't guarantee that the same functionality would be supported on Jira Server Automation

Sadath Ali Syed June 11, 2021

EmpIDs entered are alpha-numeric. Most of them enters it as abc123. However, few enter them as abc 123 (with space). We dont have validators/restrictions in place. Our Jira version is 8.13 server. Version of Automation for Jira is 7.3.3.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2021

How sophisticated do you expect the EmpID matching to be? Would you try to implement something that would consider "abc123" and "abc 123" to be a match? You might want to consider adding some validation to that field so that you are more likely to get conclusive matches.

Sadath Ali Syed June 12, 2021

@Trudy Claspill - Thanks for your time. The solution David provided worked out for us.

Suggest an answer

Log in or Sign up to answer