JMWE Validator create Issuetype by Project Area Role

Tyas Iglecias August 1, 2021

Hi, Guys,

Im need to create validator for Role who can create specific workflow used JMWE, since jira don't have creator setting for specific issuetype

I try create Build-your-own (scripted) Validator
I Look in Global variable : user.getProjectRoles(issue.project)

but I dont know how to use it.
Can you how to create validator for issuetype "task" can created by user role "IT Project Manager"?

4 answers

1 vote
Tyas Iglecias August 2, 2021

Hi @Suprija Sirikonda _Appfire_ ,


Thank you so much, it's work


Regards,
Tyas

1 vote
Suprija Sirikonda _Appfire_
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.
August 2, 2021

Hi @Tyas Iglecias ,

Modify the Jira Expression to below, which also checks the accountId of the user.

(!!issue.issueType && issue.issueType.name != "Task") || user.getProjectRoles(issue.project).some(pr => pr.name == "IT Project Manager") || user.accountId == "xxxxx"

Replace xxxxx with the accountId of the JMWE add-on user.

To insert the accountId of any user, select "Lookup user", search for the desired user and click on "Insert accountId".

 

Lookup user.png

 

 

Hope this helps!

Regards,

Suprija

1 vote
Suprija Sirikonda _Appfire_
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.
August 1, 2021

Hi @Tyas Iglecias ,

Add the below Jira Expression in "Build-your-own (scripted) Validator (JMWE app)", which returns true for Task issue type, only if the user is in the "IT Project Manager" role of that project (and returns true for issue types other than Task, irrespective of the user's role) : 

(!!issue.issueType && issue.issueType.name != "Task") || user.getProjectRoles(issue.project).some(pr => pr.name == "IT Project Manager")

 Hope this helps!

Regards,

Suprija

0 votes
Tyas Iglecias August 2, 2021

Hi @Suprija Sirikonda _Appfire_ 

Thanks for information, it works

I have another question,

how to set validation, Task can created by user role and automate by JMWE? 
cause I not found JMWE as user/role/group

image.png

and what i know, Task can't create automate if we just set validation as role "Project Manager"


Regards,
Tyas
 

Suggest an answer

Log in or Sign up to answer