Need to prevent parent's assignee to be same as child's

Saira September 12, 2022

Hi,

I am trying to see what's wrong with the scriptrunner syntax - trying to put it in workflow validateScreen Shot 2022-09-12 at 8.43.38 PM.png

3 answers

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 13, 2022

Hi @Saira ,

a workflow validator can help you on that during transition opertion. Btw, a ticket could be reassigned through an assign operation that doesn't involve a validator. 

0 votes
Saira September 12, 2022

what should i add to check if the assignee is not null for either child or parent task?

0 votes
Thuan, Do Dang
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.
September 12, 2022

Hi @Saira ,

You can select an issue > click Test > click View result for more script validator log.

Your script currently wrong syntax, it should be issue.parent.assignee.accountId != issue.assignee.accountId

If your issue-parent is issue - sub-task.

Hope this helps!

Saira September 12, 2022

that did help!

Saira September 12, 2022

But now I want to implement similar test for reporter

so I used

issue.parent.reporter.accountId != issue.assignee.accountId

 

but it does not prevent transition

Saira September 12, 2022

nvm it worked!

Saira September 12, 2022

what should i add to check if the assignee is not null for either child or parent task?

Saira September 13, 2022

@Thuan, Do Dang ,

One more question - now that you helped answer my first one :D 

I have a parent issue that has two subtasks - suppose task A and task B

I want task B's assignee to not be the same as task A's. Task A has a label, let's call that X.

How do I write a scriptrunner script to restrict transition of task B if task A and B have the same assignee ?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events