You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.