Hi,
What is the syntax to get a custome field value during a transition?
let me elaborate :
I have a screen that shows a custome field which the user can change, I would like to get the updated value of this field in a groovt scirpt I'm running as part of the transition.
Try something like the following
import com.atlassian.jira.issue.Issue; import com.atlassian.jira.issue.fields.CustomField; import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.issue.CustomFieldManager; CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager(); CustomField customField_test = customFieldManager.getCustomFieldObject( id ); def test_value = issue.getCustomFieldValue( customField_test )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes you could use it. A related question is here
I think the script i have provided will do the job for you if the sequence of postfunctions is right. Test it first. I use something similar in some postfunctions and works fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
cfValues['Name of field'] should work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The regular way as suggested here worked just fine .
When do one need to use transientVars[
"issue"
] ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.ComponentManager ComponentManager componentManager = ComponentManager.getInstance() CustomFieldManager customFieldManager = componentManager.getCustomFieldManager() cfParent = customFieldManager.getCustomFieldObjectByName('Computer Needs') parentMyFieldValue = transientVars["issue"].getCustomFieldValue(cfParent)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
may be
transientVars["issue"].CustomFieldId
It works for
transientVars["issue"].Summary etc
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.