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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.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 Administrators does not exist return false
if (!projectRole)
return false
//will return true or false if the user is in Administrators role
def isInRole = roleManager.getProjectRoleActors(projectRole, issue.getProjectObject())?.getApplicationUsers()?.contains(user)
return isInRole
#########################################################"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.ComponentAccessor
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def shouldBeDisabled = jiraHelper.project?.key =="AAA" && currentUser.username in ["AA","BB","CC","DD"]
return !shouldBeDisabled
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ilya Turov ,
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well, what was left is to play with conditinos a bit:
import com.atlassian.jira.component.ComponentAccessor
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def shouldBeShown = jiraHelper.project?.key !="AAA" || currentUser.username in ["AA","BB","CC","DD"]
return shouldBeShown
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!
Join an Atlassian Community Event!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.