Hello everybody. I have 2 different custom fields in issue (e.g cF1 and cF2) and I need functionality when I change cF1 the cF2 should changed automatically to another value and should be hilighted with some color.
I suppose I can use Custom Script Field, where in InlineScript field I can write script which returns the value of cF2 to custom template field, where I can change color of field.
But:
1. what should I do to change cF2? (Write a custom listener script, which changes cF2 when cF1 changed or I can change cF2 in the Custom Script Field or some other ideas)?
2. how to write template, which changed field background? (please example)
If you create a Scripted Field, it does not hold any value.
It only renders what you have scripted, on the fly.
So if cf2 is outputting a value, based on cf1 value, then if cf1 changes, also the cf2 output will change.
So, may be this can be decision? https://confluence.atlassian.com/jirakb/populate-a-field-based-on-another-field-s-content-in-jira-server-649921383.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No that tutorial involves javascript, meaning using Jira stock.
You just need to create a scripted field, select it's output format (template) "HTML".
Then you can use groovy to calculate the logic and return a html in string format.
Example
def returnArg
switch(issue.priority.name){
case "Low":
returnArg = "green"
break
case "High":
returnArg = "red"
break
default :
returnArg="yellow"
break
}
return "<h4 style='color:${returnArg}'>Test me</h4>"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.