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
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
I need to create a new field called and automate a process, which I will explain below.
1. Let him check the type of problem.
2. Check the value of the "Epic Link" field for that issue.
3. Add that value to the new created field.
4. And in case it is a subtask problem, find the value of the "Epic link" field of the parent task of that subtask and add it to the new field of that subtask ... since as you well know, that field " Epica Link "does not appear in subtasks.
I have thought with MyGroovy but I have never done it, I do not know if they could give me a hand.
Thanks in advance.
def customFieldManagerPackges = ComponentAccessor.getCustomFieldManager()
def cFieldLinkEpica = customFieldManagerPackges.getCustomFieldObject("customfield_10002")
def cFieldValueLinkEpica = issue.getCustomFieldValue(cFieldLinkEpica).toString()
def cFieldValue = issue.getCustomFieldValue(cFieldLinkEpica)
def cFieldEnlaceÉpicaAux = customFieldManager.getCustomFieldObjectByName("Textcustomfield_13403¨)
I get an error in the last Issue field
I think, your problem is not related to MyGroovy, but to the Jira API.
I don't know if it's the best solution, but this should work for you:
// issue.setCustomFieldValue(cFieldEnlaceÉpicaAux, cFieldValue)
Object oldValue = issue.getCustomFieldValue(cFieldEnlaceÉpicaAux);
ModifiedValue modifiedValue = new ModifiedValue(oldValue, cFieldValue);
IssueChangeHolder changeHolder = new DefaultIssueChangeHolder();
cFieldEnlaceÉpicaAux.updateValue(null, issue, modifiedValue, changeHolder);
Hope that helps.