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

How would I hide "Log Work" field with behaviour (scriptrunner)?

Angel Ferreira April 29, 2024

Hi,

How would I hide "Log Work" field with behaviour (scriptrunner) in the create screen,

I have this code but doesn´t work

______________________________________________________________________________________

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor

 
def Result = getFieldById(getFieldChanged()).getValue()

if( Result == "No"){

   
    getFieldByName('Log Work').setHidden(true)
   
}

if( Result == 'Si'){

    getFieldByName('Log Work').setHidden(false)
   
}
______________________________________________________________________________________
Thanks

1 answer

0 votes
Stefan Stadler April 29, 2024

Hi Angel,

the script you are showing should actually work already. I believe this is related to where you define this script. As you want to react on the change for your "Result" field, you have to assign this server-side script to this field configuration.

I could also imagine, that the naming of the field is not that correct. Maybe it is similar to the Original estimate and Remaining estimate, which are part of the same field "Time tracking"?

Can you post a screenshot how you added this so that we can verify?

Regards,

Stefan

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events