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

This widget could not be displayed.

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
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

428 views 3 17
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