Hi All,
I have created a scripted post function in my workflow. This function is to color issues based on the value of a custom scripted field called Rating. There are no errors in the script or failures, but i am not seeing the post function do it's thing. here is the script:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
// Set the name of the Rating field
def ratingFieldName = "Rating"
// Set the colors for each range
def redColor = "#FF0000"
def orangeColor = "#FFA500"
def yellowColor = "#FFFF00"
def noColor = "null"
// Get the custom field for the Rating field
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def ratingField = customFieldManager.getCustomFieldObjectByName(ratingFieldName)
// Get the Rating value for the current issue
def ratingValue = issue.getCustomFieldValue(ratingField) as Integer
// Set the color based on the Rating value
if (ratingValue >= 13 && ratingValue <= 16) {
["style": "background-color: $redColor"]
} else if (ratingValue >= 9 && ratingValue <= 12) {
["style": "background-color: $orangeColor"]
} else if (ratingValue >= 4 && ratingValue <= 8) {
["style": "background-color: $yellowColor"]
} else {
["style": "background-color: $noColor"]
}
i have selected the workflow as the transition view.
Any additional steps im missing?
Thanks,
Sasha