I wrote a script for a radio button custom field to change the color when an option is chosen. I previewed an issue, and it returned the value, but it is not changing the color on the view screen.
Whee did you wrote that script? can you share your code to review it?
Regards,
Seba
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi! Below script that I wrote few years ago for similar thing. It worked. Maybe this will help you to solve this.
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObject("customfield_11702")
def cFieldValue = issue.getCustomFieldValue(cField)
if(cFieldValue == 'R') {
return "<div style='color:red;background-color:red;width:20px;border-radius:50%;'>" + cFieldValue + "</div>"
}
if(cFieldValue == 'G') {
return "<div style='color:green;background-color:green;width:20px;border-radius:50%;'>" + cFieldValue + "</div>"
}
if(cFieldValue == 'Y') {
return "<div style='color:yellow;background-color:yellow;width:20px;border-radius:50%;'>" + cFieldValue + "</div>"
}
Regards,
Seba
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I Came out right. My configurations on the screens were incorrect
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you need to use Scriptrunner fragments for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc -Devoteam- I went through the documentation and attempted to use Fagments to solve this issue but I am lost. Do you have an example that I can maybe use?
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.