May I know
field.updateValue(null, currentIssue, new ModifiedValue(issue.getCustomFieldValue(field), parentMyFieldValue),changeHolder);
what does tghe null in the argument indicate here?
I am aware that currentIssue means the Issue whose value need to be changed ACCORDING TO THE PARENT ISSUE FIELD and ModifiedValue method sets child field value to value present in parent field. But, not sure why that null is used.
Joshua Yamdogo @ Adaptavist Hi Joshua..I have a situation wherein I have to copy a custom field checkbox value of parent epic issue to custom file checkbox field of child story.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObject('customfield_10434')
Issue currentIssue = getIssueContext() as Issue
def parentFieldValue = currentIssue.parentObject.getCustomFieldValue(field)
def changeHolder = new DefaultIssueChangeHolder();
def currentIssueStatus = currentIssue.getStatus().getName()
if(currentIssueStatus=="Open"){
field.updateValue(null, currentIssue, new ModifiedValue(currentIssue.getCustomFieldValue(field), parentFieldValue),changeHolder);
}
I tried the above code but its not working...can anyone help me with this?? Any leads appreciated!
Where is this script being used? Post-function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can read more about the updateValue() method here:
The first parameter is for the FieldLayoutItem variable. https://docs.atlassian.com/software/jira/docs/api/7.8.0/com/atlassian/jira/issue/fields/layout/field/FieldLayoutItem.html
Null gets passed in when you don't have any FieldLayoutItem variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.