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

Issue security based on group level

Sanu Soman May 26, 2013

We have three service desk group, like SD1, SD2 & SD3, and having Developer groups like DEV1, DEV2 & DEV3 and also having another kind of groups for customers like CU1, CU2 & CU3.

In a project, suppose SD1 creates a ticket then only SD1 and DEV1 can see the ticket. If Dev1 escalate the ticket to the CU1 then all service desk groups can able to see the ticket. like..

Could these possible in JIRA?

Many thanks in advance :)

5 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Tsol
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 26, 2013

You could use groovy script runner and add the following script to your workflow as postfunction.

I haven't tested it, but should work. Script is the following:

import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.comments.CommentManager;
import com.atlassian.jira.project.Project;
import java.util.HashMap;
import java.util.Map;
  

// get issue reporter

String reporter_usr = issue.getReporterId() ;


if ( reporter_usr == 'user_a' ){

issue.setSecurityLevelId(security_level_id)

} else {

issue.setSecurityLevelId(security_level_id)
    
}

Cheers

Sanu Soman May 26, 2013

Many thanks Kostas :) This is working fine.

Sorry to ask you, my original requirement is that, we have three service desk groups and respective three developer groups and above all three escalated groups.

So, whenever service desk 1 creates the ticket, only it can be view between Service Desk1 and developer group1, if SD2 creates then only SD2 and Dev2 can see the ticket.

If dev1, dev2 or dev3 escalate the ticket then all the sevice desk teams can see the tickets.

So if possible could you please help me to create the script for the above scenario?

Tsol
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 26, 2013

Hey Sanu,

your scenario is not something difficult.

First of all create your security level with the appropriate groups:

  • restricted to dev1
  • restricted to dev2
  • ....
  • restricted to dev_x
  • restricted to all dev team

or any other security level fit your needs.

I'll check it tomorrow morning the api and i'll post the code.

Cheers

Sanu Soman May 27, 2013

Cheers Kostas :)

I'm waiting for your reply. Thanks

Tsol
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 27, 2013

Hey Sanu,

the code for setting the security level according to reporter group is the following

import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.security.groups.GroupManager;

import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;



GroupManager groupManager = ComponentManager.getComponentInstanceOfType(GroupManager.class)
 
//String reporter_usr = issue.getReporterId() ;



if ( groupManager.isUserInGroup(issue.getReporterId(), "group_ name_1")) {
    issue.setSecurityLevelId(security_level_id_1)
} else if ( groupManager.isUserInGroup(issue.getReporterId(), "group_ name_2")) {
    issue.setSecurityLevelId(security_level_id_2)
} else if ( groupManager.isUserInGroup(issue.getReporterId(), "group_ name_3")) {
	issue.setSecurityLevelId(security_level_id_3)
}

Test it first because i haven't.

For the escalation there are different approaches. If you use a field that indicates the escalation i think you should use a listener that catches the field value change and sets the appopriate security level.

If you use a workflow transition for escalating you have to create a script that sets the issue security level to the appropriate value.

Maybe there are more options to change issue security level when escalating issue.

Cheers

Sanu Soman May 27, 2013

Many thanks Kostas :) It's working fine :)

It's awesome!! I'm planning to create two scripts (for two kind of escalations) and adding into workflow post-functions. I guess this approach will be easier one.

Cheers :) :)

0 votes
Theinvisibleman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 27, 2013

Hi Sanu,

Just to add on, I managed to find this Improvement Request for the ability to configure issue security based on Group here : JRA-5276.

I would recommend that you do the following on the feature request ticket :

* Vote, so that it will receive more attention

* Watch it, so that you will receive any and all updates

* Comment, and give your opinion on the matter

Please note that the implementation of new features and improvement requests falls under Atlassian's Implementation of New Features Policy.

Sanu Soman May 27, 2013

Yesterday itself I've voted and commented on this feature request.

0 votes
Nadir MEZIANI
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 26, 2013

Hi,

You can do it like this:

Create issue levels security :

LEV1 which contain two groups (SD1, DEV1)

LEV12 which contain two groups (SD1, DEV1,CU1)

When issue created , make level security LEV1 and when the issue escalated make level security LEV12

Sanu Soman May 26, 2013

But how I can automatically set the security level based on the reporter of the issue. Means, if SD1 creates then SD1 & DEV1 has the view permission and if SD2 creates then SD2 and DEV2 havinng the perssion??

Nadir MEZIANI
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 26, 2013

Hi,

you can use JavaScript and REST-API, if there is screen or

use JJUPIN in the post function

0 votes
Jobin Kuruvilla [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.
May 26, 2013

You will have to develop certain workflow post functions which sets the security level based on who creates/escalates the issue. The post functions should implement the rules you mentioned.

Sanu Soman May 26, 2013

Are you talking about the groovy script?

0 votes
Timothy
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 26, 2013

Yes. You'll just have to configure them properly.

Sanu Soman May 26, 2013

How I can achieve this?

Timothy
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 26, 2013
Sanu Soman May 26, 2013

As far as my knowledge, I think above scenario is not possilbe with JIRA default issue security configuration. Because default one will not give issue security based on assignee or status of the issue.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events