HIya people.
I'm kind of new to transitions, so I'm not really sure if this is possible or not. I have a custom field of type Radio button (basically just a yes/no) which may be initially set creating an issue. What it should do is, if the radiobutton is yes, it should add a prefix to the comment and if no, no prefix.
here is the codeblock:
import com.atlassian.jira.component.ComponentAccessor
def customFieldName = "User Communication"
def prefixComment = "*Public Comment*"
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def field = customFieldManager.getCustomFieldObjectByName(customFieldName)
def option = issue.getCustomFieldValue(field)
log.warn(field.getValue(issue))
for(String optionValue : field.getValue(issue))
{
log.warn(optionValue)
if(optionValue.equals("Yes"))
{
transientVars.comment = prefixComment + " " + transientVars.comment
}
else
{
// do something
}
}
Lets say the radiobutton is NO, and i go to workflow -> Done, and in the transition screen i want to change the radiobutton to yes (so it should add a prefix to the comment) the customfield doesn't seem to get "updated", it's still just the original value from the issue screen.
So when i run my code, it prints out no and not "yes" as i selected in the screen..
Im using jira software 7.7.0
Is there any way to get the "updated" value of the customfield in the transitionscreen?