Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we restrict user "Close issue" on specific field of issue?

Mark January 16, 2019

We have a JIRA project setup. There are 3 teams share this project. There is a field "team" classify this issue is belonging to which team. Each team's lead have permission to "close issue".

Sometimes, by mistake, team A leader close team B's issue. Team B may not aware of the missing issue because they have many new issues pending every day.

To avoid the problem, we would like to restrict by permission or any other means. i.e. Team A lead can only close issue which [team=teamA]. May I have your suggestion?

2 answers

0 votes
Alexey Matveev
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.
January 17, 2019

Hello,

You would need an add-on for it.

For example you could use the Power Scripts add-on:

https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview:

You could write a validator with a code like this:

if (#{team custom field} == "team1" && currentUser() == "user1") {

  return true;

}

if (#{team custom field} == "team2" && currentUser() == "user2") {

  return true;

}

if (#{team custom field} == "team3" && currentUser() == "user3") {

  return true;

}

return false;
0 votes
Elifcan Cakmak
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.
January 17, 2019

Hello,

I don't think there is an out of the box solution for this.

If you have script runner add-on, you can write a scripted condition that checks the field value and allows users in a specific group in jira, if you keep these teams as groups. Such as:

if team=teamA and logged in user is in group teamA then passesCondition

an so on for other teams.

Regards,

Elifcan

Mark January 23, 2019

I am going to use scriptrunner. But it is too powerful and document is quite details. Do you mind point me where should I start to build the trigger I need?

Elifcan Cakmak
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.
January 24, 2019

Hi,

Check out this documentation, this is a different example but what you need is also a simple scripted condition :

https://scriptrunner.adaptavist.com/latest/jira/recipes/workflow/conditions/simple-scripted-condition.html

When you write a condition, if the result returns true, that user can make the transition. So, here what you need to do is basically write a script that have these conditions:

if team=teamA and logged in user is in group teamA or

if team=teamB and logged in user is in group teamB or

if team=teamB and logged in user is in group teamB

return true

You need to add it to the conditions of the transition of your workflow.

Regards,

Elifcan

Mark January 24, 2019

I am sorry. I installed script runner and then I don't know how to start. I don't know where is the console or how to import my script.

Elifcan Cakmak
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.
January 24, 2019

Hi, 

Do you know gg function of jira? Press gg on your keyboard and then search where you want to go. For example press gg and search for script console. On script console, you can test your scripts.

But, what you need to do here is, as I said in my above comment, you need to add the script as a condition on your workflow.

Regards,

Elifcan

Mark January 24, 2019

Yes I know gg function. I try to search "script" I can only get to "Script runner" page which only tell me I am not licensed. Type in "console" I get nothing return.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events