Hide Story Points for particular group.

I am trying to use the Behaviours plugin to hide the Story points field except some user in specific project.

I get the warning: The field Story Points is not hideable, so it will only be hidden when the issue is editable. More info.

But the Link is not working and the field is shown for all user also in edit screen. Can you give me some more information or a tip for workaround?

JIRA Version : 6.3.8

Behaviour Plugin - Adaptavist ScriptRunner for JIRA Standard Edition: 3.1.4

Thanks in advance

Best Regards

1 answer

Hi GoodGame Studios,

I have enclosed a sample script and screenshot of its configuration using the Behaviours plugin which shows how you apply a behaviour on the Story Points field which will get the Story points field by its ID and only display this to users in a certain group and hide it to all other users.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.util.UserUtil
  
// Get pointers to the custom field(s) required
def cf = getFieldById("customfield_10008")
  
// Get the current logged in user
def user = ComponentAccessor.getJiraAuthenticationContext().getUser().name
  
// Get a pointer to the resticted fields group
UserUtil userUtil = ComponentAccessor.getUserUtil()
def group =  userUtil.getGroupObject("restricted-fields")
  
// By default make the field visible to all users.
    cf.setHidden(false)
  
if(userUtil.getGroupsForUser(user).contains(group)){
 // If the user is in the restricted groups field then hide the field
    cf.setHidden(true)
}

image2016-5-12 17:59:39.png

 

This script was developed on JIRA 6.4.12 using the latest version of ScriptRunner.

I hope this helps

Thanks

Kristian

Thanks for posting this Kristain! It exactly what I needed :)

Hi Alex,

If this answer resolved your issue can you please accept it to mark it as correct to help other users searching for a similar solution.

Kristian

Hey Kristain, if I was the OP here I totally would!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

163 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you