Hello,
in my very first groovy I am trying to get all the information from a referenced insight object.
-> Datacenter/ workflow post function.
let's say one of my fields i want to transfer is name of service - issueNameCF - the field on the issue and insightNameCF - from the Insight object.
I have an insight field on the issue - issueServiceCF.
/* Custom field for the Name and Service */
CustomField serviceCF = customFieldManager.getCustomFieldObject(11054);
def issueNameCF = customFieldManager.getCustomFieldObjectByName("Name");
CustomField nameCF = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(10000);
def insightNameCF = issue.getCustomFieldValue(nameCF);
issue.setCustomFieldValue(issueNameCF, insightNameCF)
return true;
is this already enough to make a connection between issue.customField and issue.customfield.insightfield ? so let's say, get the value from the insight field, something like this.
issueNameCF = issueServiceCF.insightNameCF ?
Thank you!
If you would like a more straightforward approach to gathering the details from Insignt / Assets, I suggest looking into ScriptRunner's HAPI feature.
You can refer to this ScriptRunner Documentation for examples of how to work with the Assets and gather the details.
To be able to use these features, please ensure that you upgrade your ScriptRunner plugin to at least 7.11.0. I recommend upgrading to the latest release, i.e. 8.3.0.
I hope this helps to answer your question. :-)
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.