Hello,
i'm want to hide only Remaining Estimate field (Original Estimate should be available ) based on issueType on Create or other transition screens
how can i do it using js or script runner
Thanks.
then add a behaviour and write in initialiser
getFieldById("timetracking_remainingestimate").setHidden(true)
with proper mapping you can do it for needed issuetypes.
You can hide the time tracking element using Scriptrunner's Hide UI Element
The element to hide is called "com.atlassian.jira.jira-view-issue-plugin:timetrackingmodule"
Also note that "condition" is about when you want to show the item, so if you want to hide it only for issue type called "Bug" (and display for other) you write
issue.issueType?.name != "Bug"
thanks Ilya, but i want to hide only Remaining Estimate and Original Estimate should be available. im talking about field in the create screen or transition screens
@Ilya Turov Thank !!
Hi @Ilya Turov ,
I want to hide clone option. Below are my scenario
1) Project = "AAA" and Except users (AA,BB,CC,DD) clone option should disabled. My Code
import com.atlassian.jira.component.ComponentAccessor
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def userUtil = ComponentAccessor.getUserUtil()
!(jiraHelper.project?.key =="AAA")if(currentUser.getUsername() in ["AA","BB","CC","DD"]){return true}
My Code are not working. Did I missed anything ?
CC @Alexey Matveev @JamieA
I'm honored to be in same mentions with such refined lads, but seriously speaking, if you want to hide the "clone issue" button you can't do it with behaviours, guess you are doing it using "script fragments" - "hide UI element", in this case
Note that the item will be displayed if the code returns a truthy object.
and I feel like your code might look like this:
import com.atlassian.jira.component.ComponentAccessordef currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()def shouldBeDisabled = jiraHelper.project?.key =="AAA" && currentUser.username in ["AA","BB","CC","DD"]return !shouldBeDisabled
Yes am Updating in Web Fragements.
Your script is working, but the problem is not resticting in all Jira Projects. My goal is to restrict to few projects and other porjects all users should have Clone option.
Regards,
Parthiban
well, what was left is to play with conditinos a bit:
import com.atlassian.jira.component.ComponentAccessordef currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()def shouldBeShown = jiraHelper.project?.key !="AAA" || currentUser.username in ["AA","BB","CC","DD"]return shouldBeShown
Hi
I use ScriptRunner to hide timetraking for all users that are not in "developer role" for any project in my JIRA.
Unfortunatly, they can still see the "Original Estimate " and "Remaining Estimate" fields when opening any issue edition screen
In the "Hide What" section of "fragments" configuration, i added "com.atlassian.jira.jira-view-issue-plugin:timetrackingmodule"
And there is my Script :
#########################################################"
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.security.roles.ProjectRoleManager
//Issue issue = issuedef user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()def roleManager = ComponentAccessor.getComponent(ProjectRoleManager)def projectRole = roleManager.getProjectRole("Developers")//if project role Administrators does not exist return falseif (!projectRole)return false
//will return true or false if the user is in Administrators roledef isInRole = roleManager.getProjectRoleActors(projectRole, issue.getProjectObject())?.getApplicationUsers()?.contains(user)return isInRole
Hi @Ilya Turov,
Thank you for your response. We had a similar requirement and it worked for us, but it removed the remaining estimate field from everywhere on that particular issue type including the log hours screen as well.
Is there a way we just remove it just from create/edit screen but keep it on the screen where we log hours?
It looks like you're new here. Sign in or register to get started.