Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JMWE Validator create Issuetype by Project Area Role

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"?

1 comment

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

Like Tyas Iglecias likes this

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
 

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

Like Tyas Iglecias likes this

Hi @Suprija Sirikonda _Appfire_ ,


Thank you so much, it's work


Regards,
Tyas

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Apps & Integrations

🍂📹 Apptoberfest demo contest roundup: vote for your favorite demos!

Hi Community! The submissions are in (and listed below) for the 🍻🍂Apptoberfest🍂🍻 Demo Competition and it’s time for you to place your votes for the best: Analytics & reporting app demo ...

210 views 5 14
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you