Newbie question:
I need some help to get the assignee of the parent issue type in a sub-task transition.
Scenario
How can this be achieved in a sub-task transition using a scripted condition?
I tried the below:
issue.getAssignee() == return(parentIssue?.get("assignee")?.getName())
This gives me the below error:
The script could not be compiled:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script562.groovy: 1: unexpected token: return @ line 1, column 24. issue.getAssignee() == return(parentIssue?.get("assignee")?.getName()) ^ 1 error
You can get parent using.
issue.getParentObject()?.getAssignee()
I hope it helps. Issue could be unassigned so add checked in your code.
Ravi
Hello @Ravi Sagar _Sparxsys_
Thank you as always. This worked pretty well.
We would not worry much about the ticket being unassigned, as the process is such, that the parent ticket is always assigned to a user 'X'.
Best Regards,
Rahul Savaikar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Ravi Sagar _Sparxsys_
Need some quick help - I tried adding the below as a Simple scripted condition to the sub-task workflow transition:
issue.issueType.name == 'Corrective action' && (issue.getAssignee() == issue.getParentObject()?.getAssignee())
However, the result is that, the transition is either shown to all (whether the assignee of the parent ticket or not) or not shown at all.
Even if I simply add a simple scripted condition as below, to the transition, it shows a similar behaviour as described above.
issue.getParentObject()?.getAssignee()
How can I compare the Sub-task Assignee and the Parent task Assignee in my case? Is my statement correct to compare both these attributes?
Regards,
Rahul Savaikar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.