Return priority field with gif
Hello again, i am working on a script that takes in two values and returns out the priority based on an else if statement. The script runs fine and will return the priority but it comes out as just Medium, I need it to come out as Medium with the gif image that is set in the enumerations. Does anyone know what that attribute id might be as I think that might be my idea as why it is not outputting right.
Here is the script I'm using
if (risk === 'High' & severity === 'Minor' ){
priority = 'Medium';
}else if (risk === 'High' & severity === 'Major' ){
priority ='High';
}else if (risk=== 'High' & severity === 'Critical' ){
priority ='Critical' ;
}else if (risk === 'Low' & severity === 'Minor' ){
priority ='Low' ;
}else if (risk === 'Low' & severity === 'Major' ){
priority ='Medium' ;
}else{
priority = 'Critical';
Thanks
Here is the script I'm using
if (risk === 'High' & severity === 'Minor' ){
priority = 'Medium';
}else if (risk === 'High' & severity === 'Major' ){
priority ='High';
}else if (risk=== 'High' & severity === 'Critical' ){
priority ='Critical' ;
}else if (risk === 'Low' & severity === 'Minor' ){
priority ='Low' ;
}else if (risk === 'Low' & severity === 'Major' ){
priority ='Medium' ;
}else{
priority = 'Critical';
Thanks
One answer
You need to use the Id of the Priority Enumeration, such as "priority.literal.l07", not its literal value "Medium". You are setting an invalid value to the attribute and that's why the associated icon does not come up.
Comments
Thanks but putting in the priority literal, just makes it say priority literal.
I don't understand your intention. Why do you insist on putting the literal value? You can even put in a random string if you really want, but the script will not work. The only valid value for a Priority enumeration type attribute is the Id.