Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Update Parent Issue Custom Field when new value added in Child issue Field(Same Field as Parent's)

Update Parent Issue Custom Field when new value added in Child issue Field(Same Field as Parent's)

J Manas Kumar
Contributor
February 6, 2020

Hi 

 

I have one EPIC issue which contains a Multiple value selection Custom Field.(created a normal multiline field and converted it into Multi Select Value Field using JQL).

And this epic issue has a Parent Field which also contains same custom field.

My requirement is , when ever i will add any value in child issue, my parent field also get updated with the value if that wont be there in parent issue's custom field.

 

So for this i have tried a listener and also tried to fetch those data present in Child Issue's Field. And one qes even if i got those data , how to compare both custom fields and add those only which are unique?

I know one method "Intersects", but not sure how to use it.

But i am unable to do it. its not working in script runner too.And how to check those values i got?

Can anyone help me on this.? Any Help will be appreciated.

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.user.ApplicationUser;
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.user.util.UserUtil
import com.atlassian.jira.event.type.EventDispatchOption

 

 

def issue = event.issue as Issue
//def issue1 = issue.getIssueType().getName() == 'EPIC'
UserUtil userUtil = ComponentAccessor.userUtil
//def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = ComponentAccessor.getComponent(CustomFieldManager).getCustomFieldObject("customfield_10602")
def myUser = customField.getValueFromIssue(issue)
log.info "check this user: " + myUser

 

 

 

Regards

Manas

0 answers

Suggest an answer

Log in or Sign up to answer