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,467,382
Community Members
 
Community Events
177
Community Groups

Setup for automatic issue security level settings

Hi support,

We are trying to setup a functionality where the issue security level is set per user group.

We are using JIRA 6.4.10 with Service Desk 2.5.9 and ScriptRunner 4.1.3.9.

Script runner provides this functionality in JIRA workflows.

Somehow it does not work for us.

What we did: 

  1. Setup a user group "sec-customers"
  2. Setup a user group "sec-agents"
  3. Set an issue security scheme "sec" with one security level "sec-request" and assigned the above user groups
  4. In the project we set permission "Set Issue Security" to allow the above groups to set the issue security.
  5. In the workflow of the project, on the "Create Issue" transition we added a post function (provided by script runner) to set the issue security level depending on the reporter's user group, changed the group to "sec-customers" and the security level to "sec-request"

Expected result:

When a member of the group sec-customers logs an issue the security level should be set to "sec-request"

Actual result:

The security level is set to "None" (or is not set)

 

We checked the code by adding a scripted field with the same code as in the post function an it returns "true" for the issues created by "sec-customers", so it should as well work in the post function.

If you wish we can have a look at our system configuration together.

 

Thanks and regards,

Oliver Weiser

 

3 answers

1 accepted

2 votes
Answer accepted

Hi Oliver,

Can you please advise if you placed the post function as the last post function in the list on the create transition.

Also can you please share with us the following items below so that we can look to replicate and troubleshoot this for you:

  1. The code that you have configured in the post function along with a screenshot of how you have configured this.
  2. The version of JIRA and Script Runner that you are using.
  3. An extract of the atlassian-jira.log file from when this post function is executed.

Thanks

Kristian

Hi Kristain,

Thanks for your reply.

Actually the post function was in the last to be executed. Funny enough through your hint with the order I placed it as the first action to be executed, even before the issue is created and now it works...

Thanks and regards,

Oliver

Hi Oliver,

Im glad I was able to help.

Kristian

ciao @Kristian Walker _Adaptavist_  

I am trying to do set issue security based on a custom field. I have a custom field that is called Assignment Group. It is a custom field of type Group Picker from Jira. When an issue transits from To Do to In Progress I want to put a post-function in the workflow so that the issue takes the security level equal to the value of the Group Picker. There are three security levels: level-1, level-2 and level-3. The Assignee Groups are three and they are called in the same way: level-1, level-2 and level-3. I do not know how Script Runner can copy the value of the Assignee Group field and put it in the Issue Security Level field. Can anyone help me ?

Hello! 

 

I am having the same problem - I've written the script in the Script Runner post function and also placed this post function at the top of the list. It still does not work! Here is what my code looks like - 

 

import com.atlassian.jira.component.ComponentAccessor

def groupManager = ComponentAccessor.getGroupManager()

groupManager.isUserInGroup(issue.reporter?.name, 'TestUser')

 

 

TestUser is the group in which I want the Security Level to be automatically set to Company 1. Any suggestions? Thanks in advance. 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events