Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Script Runn : How can i hide "Original Estimation" &&"Remaining Estimation" from issue edition screen

Nejjari Noureddine
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 15, 2020

Hi,

I use "Fragments module off Script Runner add-on to hide time tracking for a specific user role.


My script is well configured but users can still see those two fields when they edit or modify issues

In the "Hide What" Section" : I have set all possibilities :

  • com.atlassian.jira.jira-view-issue-plugin:timetrackingmodule
  • com.atlassian.jira.jira-view-issue-plugin:create-worklog
  • is.origo.jira.tempo-plugin:add-hours-on-issue
  • is.origo.jira.tempo-plugin:plan-hours-on-issue
  • is.origo.jira.tempo-plugin:plan-hours-on-issue-link
  • is.origo.jira.tempo-plugin:tempo-project-sidebar-timesheet
  • is.origo.jira.tempo-plugin:view-hours-on-issue
  • com.atlassian.jira.jira-view-issue-plugin:activitymodule
  • com.tempoplugin.tempo-core:tempo-issue-view-panel

 

There is my Script :

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager

//Issue issue = issue
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def roleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def projectRole = roleManager.getProjectRole("Developers")

//if project role Developers does not exist return false
if (!projectRole)
return false

//will return true or false if the user is in DEvelopers role
def isInRole = roleManager.getProjectRoleActors(projectRole, issue.getProjectObject())?.getApplicationUsers()?.contains(user)

return isInRole

 

Any idea or simple way to do it please ?

1 answer

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2023

Ηι @Nejjari Noureddine 

I would use behaviours to hide these fields.

Suggest an answer

Log in or Sign up to answer