Hide Story Points for particular group.

Goodgame Studios April 21, 2016

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

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 12, 2016

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

Alex Gallien March 21, 2018

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

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 10, 2018

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

Alex Gallien April 10, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events