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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,472
Community Members
 
Community Events
185
Community Groups

Restrict Issue Type Creation for Certain Users

We have a Requirement to restrict some users for creating particular issue types

For eg - User1 (these are included in a particular Grp ) cannot Create EPIC

We have Scriptrunner and Automation any way we can do it?

2 answers

1 accepted

1 vote
Answer accepted
Somnath Patil
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.
May 15, 2023 • edited

Hi @Sanjivani Wayal ,

 

To restrict Create Epic to users in a particular group, add the  below Jira Expression Validator(Script Runner Jira Expression) to the Create Screen of Epic.

 

!user.groups.includes('Developers')

Hi @Somnath Patil  Can you please help with this where exactly do i need to write this is it in Script Console of Script runner or on some validator or Post function in workflow ?

Somnath Patil
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.
May 15, 2023

Hi @Sanjivani Wayal ,

 

As you mentioned you have ScriptRunner. Add validator on a create screen of Epic and use ScriptRunner Script validator and  paste this cod : !user.groups.includes('Developers')

Replace Developers group name with the name you want to restrict. 

I did that , its not working maybe because i have name of group of users is need to restrict like "JIRA_GRP1" and not a specific name or a single user

Somnath Patil
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.
May 16, 2023

Hi @Sanjivani Wayal ,

 

use :  user.groups.includes('JIRA_GRP1')  If you want User in "JIRA_GRP1" should be able to create issue.

 

use :   !user.groups.includes('JIRA_GRP1')  If you want to User in "JIRA_GRP1" should not be able to create issue.

Hi @Somnath Patil  Thank you so much that really worked 

 

I have 1 more question iam working on Sending Notification emails , However currently its sending the accountid and we need to change it to username and we have issues with customer name those are added in a Group any idea how can i mention it in automation i have created have below example :-

[~accountId:{{user field name.accountId}}]

Hi [~accountid:{{Squad leader.accountId}}], could you please assign this bug to someone on your team?

 

//returns Hi @Alana Grant, could you please assign this bug to someone on your team?

 

But i have the group where user names are added.

Any idea how will it work for Group when that name is mentioned in comments using @

You can use a groovy validator (Post-Function) on the Create transition of your Workflow to accomplish this. 

Hi @Judah  Which Post-Function should i use on Create Transition?

@Sanjivani Wayal - You will need to add a Validator. If the validator returns false the transition will be denied (the issue wont be created). 

We used the Scripted (Groovy) Validator provided by JMWE, but ScriptRunner also provides an option for a scripted validator and you would likely pass something like this into the script editor. 

ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "<YOUR GROUP>")


The expression must return TRUE for the transition to occur. Annotation 2023-05-16 093432.png

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