How to restrict user group to create certain issue type using Jira softward project cloud?

Ouioui Zhou
Contributor
February 17, 2022

Hi there. My team is using Jira Cloud.

We would like to restrict a user group to create certain types of issue in a project. We have 2 user groups

1) Business users are allowed to create request and bug

2) Development team users are allowed to create task, bug and epic.

Scriptrunner behaviour only supports Jira server, not Cloud.

Is there any other solution to this request? Thank you in advance!

2 answers

1 accepted

1 vote
Answer accepted
Dave Bosman [Realdolmen]
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.
February 18, 2022

Hi @Ouioui Zhou 

Out of the box this is not possible so you will have to use a plugin like JMWE and add a validator to your workflow for those specific issue types that checks if the user is in the correct group. 

Regards

Dave

Ouioui Zhou
Contributor
February 18, 2022

Hi @Dave Bosman [Realdolmen]  which validator i should use in this case? Field required validator (JMWE)? Thanks for your advice.

Nic Brough -Adaptavist-
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.
February 18, 2022

You'll need to use the "build my own validator" option.

I would caution you against doing this though, it's a horrible thing to do to your users, especially if you have more than a handful of fields to enter.  Your humans will not like spending a few minutes entering a story only to have your code say "you can't create this type of thing, I'm going to throw away everything you've just entered"

I'd take a look at the reasons you want to do this.  Should these people really be working in different projects?  Why can't developers raise requests?

Ouioui Zhou
Contributor
February 18, 2022

Hi @Nic Brough -Adaptavist- oh let me clarify our requirement. Actually we would like to display only "Request" and "Bug" in the dropdown menu for Issue Type when requestors create the form.

Is there any solution to this? Thanks!

Dave Bosman [Realdolmen]
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.
February 18, 2022

Hi @Ouioui Zhou 

I have to agree with @Nic Brough -Adaptavist- that it probably is not the best idea

However if you want to implement it, you have to build your own validator as already said. 

I presume you will need to enter something like following as a script in that Validator

user.groups.flatMap(it => it.includes("my-group-that-is-allowed-to-create-an-issue")) 

Regards

Dave

Dave Bosman [Realdolmen]
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.
February 18, 2022

@Ouioui Zhou 

Unfortunatelly, it is not possible to hide them in the form. 

Regards

Dave

Nic Brough -Adaptavist-
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.
February 18, 2022

No, @Dave Bosman [Realdolmen] 's solution of a validator is your only option on cloud, and it's clunky.  It does however work for all the different ways you can create issues, unlike the Server based Behaviour.

That's why I suggest re-evaluating what you're doing, it sounds like a broken process to me.

3 votes
Or Shaked
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 4, 2022

Sometimes it looks like JIRA insists to make our life harder..

Allowing 'Conditions' also in the 'Create' transition will solve this in 2 sec..

Is anyone familiar with another workaround that won't cost us a few hundred of bucks each month (like JMWE)?

 

Thanks,

Pradeep Cheekurthi July 12, 2023

Hi @Or Shaked ,

You know, it may sound little old, but making use of project permissions, project roles and groups will solve the issue.

Let me explain

1. In your project, if you have two different types of people, one is project managers and others are developers/business analysts etc.,. If you want to restrict the access to create an issue for a developers, give create issue permission to Project Managers and business analysts only. 

Before making this happen, you need to create a new roles project managers and business analysts in your instance and add those roles to the project permissions.

 

2. Another way is take the same people as above, but in this case you need to use the groups. For this, add the required project managers to one group and business analysts to another group and add this two groups to Create Issue permissions.

 

Hope I am clear on this. 

Apologies, if I have confused you.

 

Thanks,

Pradeep 

Arkadiusz Inglot
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.
July 14, 2023

@Pradeep CheekurthiBut initially the guy is asking about creating a SPECIFIED ISSUE TYPE ticket instead of any "issue type in project".

Like Gérald Colangelo likes this
Gérald Colangelo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 11, 2024

Agreed !

Same need here: i want just my dev team to create "Task" and "Spike", my product team and tech lead to create "Epic" and everyone create "Bug".... 
I've been fighting for two days to try to get this with workflow, validators, conditions, ticket securty, etc... but it seems unsolvable.

That's crazy as this feature sounds so "basic".

Maciej Dudziak _Forgappify_
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.
April 11, 2024

Hi @Gérald Colangelo 

I am afraid that the only option for cloud (and if you use company managed project) is to add 3rd party validator to Create transition.

I am from Forgappify and we have Jira Expression Validator, which is part of the Workflow Building Blocks for Jira free app. 

For example, if you want only users with the 'Developers' project role to be able to create Story issues, add Jira Expression Validator to the Create transition with following settings:

1. Assuming you have separate workflows for each issue type:

Jira expression:

user.getProjectRoles(issue.project).reduce(
(isAllowed, role) => isAllowed || ["Developers"].includes(role.name),
false
)

Validation message:

"You must have the Developer project role to create Story issues, but got: "   + user.getProjectRoles(issue.project).map(projectRole => projectRole.name) 

2. If you don't have separate workflows:

issue.issueType.name == "Story" 
? user.getProjectRoles(issue.project).reduce(
(isAllowed, role) => isAllowed || ["Developers"].includes(role.name),
false
)
: true

 
3. In your case it will be something similar to:

issue.issueType.name == "Task" || issue.issueType.name == "Story"
? user.getProjectRoles(issue.project).reduce(
(isAllowed, role) => isAllowed || ["Developers"].includes(role.name),
false
)
: issue.issueType.name == "Epic"
? user.getProjectRoles(issue.project).reduce(
(isAllowed, role) => isAllowed || ["TechLeaders"].includes(role.name),
false
)
: true

I hope it will help.

Cheers

 

Suggest an answer

Log in or Sign up to answer