Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

field.updateValue method explanation

Aishwarya Rajan March 15, 2018

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.

2 answers

0 votes
Aishwarya Rajan March 15, 2018

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!

Joshua Yamdogo @ Adaptavist
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 15, 2018

Where is this script being used? Post-function?

0 votes
Joshua Yamdogo @ Adaptavist
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 15, 2018

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events