Hi, atlassian community!
I have a code that pulls out the value of an attribute from an object (indicated in the "Softwate" field) with which it is associated (the attribute is indicated in the "line product" field)
My main task now is to synchronize these values in the .
(Make it so that when the field (object) "software" is changed the attribute in cF "line product" also changed (the one associated with this object was substituted)
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.component.ComponentAccessor;
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_18429");// here replace the ID with ID of your custom field.
def issueKey = "RDY-12917";
def issueManager = ComponentAccessor.getIssueManager()
def issueObject = issueManager.getIssueObject("${issueKey}")
def cfName = "ПО (актив)"
def cfPOactiv = issueObject.getCustomFieldValue("${cfName}").findAll().join("")
def regStringPOactive = (cfPOactiv =~ /RFA-\d\w+/).findAll().join("") // Ключ объекта: RFA-195553 , для ПО (актив)
def attrObjLineOfProduct = Assets.getByKey("${regStringPOactive}").getAttributeValues('Линейка продукта')
def regStringLineOfProduct = (attrObjLineOfProduct =~ /\d\w+/).findAll().join("")
def keyAttrLineOfProduct = 'RFA-'+ regStringLineOfProduct
def attrNameLineOfProduct = Assets.getByKey("${keyAttrLineOfProduct}")
def regAttrValueLineOfProduct = (attrNameLineOfProduct =~ /.*\s/).findAll().join("")
Any help is important! Thank you.