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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Please can some one help me to write script runner script to " Copy fix version from parent to sub task while creating sub task ".
fix version is a system field, not a custom field. This works for me
// inherit system fields
UpdateIssueRequest updIssReq;
UpdateIssueRequest.UpdateIssueRequestBuilder issueRequestBuilder = new UpdateIssueRequest.UpdateIssueRequestBuilder();
issueRequestBuilder.eventDispatchOption(EventDispatchOption.ISSUE_UPDATED);
issueRequestBuilder.sendMail(false);
updIssReq = new UpdateIssueRequest(issueRequestBuilder);
MutableIssue _subTask = issue as MutableIssue
def fixVersionsField = parentIssue.getFixVersions();
// add system fields to inherit before calling issueManager.updateIssue()
_subTask.setFixVersions(fixVersionsField);
issueManager.updateIssue(curUser, _subTask, updIssReq);
below script copies story points from parents to sub task while creating sub task but still i'm not able copy fix version like story points.
could some one help me to modify this script to copy fix version as well
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Story Points")
//def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("fixVersion")
def parentMyFieldValue = issue.parentObject.getCustomFieldValue(field)
def changeHolder = new DefaultIssueChangeHolder();
field.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(field), parentMyFieldValue),changeHolder);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.