Workflow Post Function: Create custom IssueSecurityLevel

ConradR
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 22, 2012

Hi,

The situation: I have different customer-groups in one project. Each customer-group has multiple members. Each member of a customer-group should see the issues of his group members. No groupmember is allowed to see other customer-groups, their members or their issues.

My approach: I made a groovy script for a workflow postfunction (on create). So now I have the new issue, the reporter and the group (I filter all groupnames of the reporter for a beginning "Customer: ")

My problem: How do I grant the group (or at least the groupmembers) the permission to view the issue? I guess the right way is to create an IssueSecurityLevel and add it to the Issue with issue.setSecurityLevel (myLevel). But how do i create this level?


Note: It is not an option to create the security-levels by hand and get them later on by their ID since I have more than 100 customer-groups.

I hope someone can help me here.

Thanks in advance! :)

con.ro

2 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
Peter Shiner February 23, 2012

Let me see.... You got:

project -> issues w/ on-create ( reporter.username, reporter.'Customer:'<organization-name> )

where username is a JIRA User Account and organization-name is the real world business name and also a portion of a JIRA Group Account with a name in the form of 'Customer:'<organization-name> in which username is a member.

And then you want to allow every member of the JIRA Group Account 'Customer:'<organization-name> to be able to view this issue but no one else (from this mechanism at least).

If I understand you correctly.... If you add a custom Group Picker field, say 'Access Group' that will be populated with the full JIRA group name of 'Customer:'<organization-name> you can set a default issue security level, say 'Customer Access Allowed' for the issues and in that default security level enable 'Group Custom Field Value(Access Group)'. The issue screen would have lines that looked like:

Security Level: [ Customer Access Allowed ]

Access Group: [ Customer: Comskil, Inc. ]

where the square brackets represent the data entry box next to the field label. All you need is all of the members of the JIRA Group 'Customer: Comski, Inc.' to be the individuals you want to see this particular issue.

Does that make sense?

ConradR
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 23, 2012

Does that make sense?

Absolutely! I stumbled across this way yesterday and it works great!

0 votes
Mizan
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 23, 2012

Hi ,

In your groovy script i assume you get the issue security scheme object . after you you have the appropriate security scheme object you can use the newLevel(String name, String description) which will return a issue security level

have a look at this . i hope it helps :)

TAGS
AUG Leaders

Atlassian Community Events