Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script Runner - Script Field

Daniel Knutsson April 23, 2018

I want to do this script but with groovy script using script runner. Is it possible? How would it look like?

<script type="text/javascript"> priority = document.getElementById('priority'); if (priority) { target = document.getElementById('customfield_10000'); // Hide the target field if priority isn't critical if (priority.value != 2) target.style.display='none'; priority.onchange=function() { if (this.value == 2) { target.style.display = ''; target.value="enter message here"; } else { target.style.display='none'; } } } </script>

 

 

2 answers

0 votes
Daniel Knutsson April 24, 2018

Thanks for the replay! Very appreciated. 

Tarun Sapra
Community Champion
April 24, 2018

Happy to help, if it works for you, please accept/upvote the answer.

0 votes
Tarun Sapra
Community Champion
April 23, 2018

Script fields is for showing calculated data based on issue data and not for show/hide of fields. From your code sample it seems you are trying to hide a custom field based on the value of priority. For achieving this you have to use the "Behaviour module" of the SR plugin instead of script fields. 

https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

Daniel Knutsson April 23, 2018

For a none developer this is not good enough documentation.  I wan't real example that I can use for this purpose. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events