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

Angel Ferreira
Contributor
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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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