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.
Here is my Script with Jira version 8.11 and Script Runner Version 6.12
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
def project = ComponentAccessor.projectManager.getProjectByCurrentKey("HC")
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def parentIssue = ComponentAccessor.issueManager.getIssueByCurrentKey("HC-1");
MutableIssue issue = ComponentAccessor.issueFactory.issue
issue.projectObject = project
issue.summary = "This Is Sub-Task"
issue.issueTypeId = 10006
issue.setReporter(loggedInUser)
issue.setReporterId("dhandaresanjay@gmail.com")
issue.assignee = loggedInUser
ComponentAccessor.issueManager.createIssueObject(loggedInUser,issue)
ComponentAccessor.subTaskManager.createSubTaskIssueLink(parentIssue,issue,loggedInUser)
But getting this error
ERROR [workflow.AbstractScriptWorkflowFunction]: Workflow script has failed on issue HC-7 for user 'sanjay'. View here: http://localhost:8080/secure/admin/workflows/ViewWorkflowTransition.jspa?workflowMode=live&workflowName=Software+Simplified+Workflow+for+Project+HC&descriptorTab=postfunctions&workflowTransition=1&highlight=4 java.lang.AssertionError: Errors: {reporter=The reporter specified is not a user.} Error Messages: []. Expression: validationResult.valid
Hi @sanjay ,
If you are using the script runner add-on in your server instance, then in the post-function please do select the script runner in that we have an option called to create a sub-task. Once you select that option you may need to fill up a few options like subtasks issue type name, condition to create the subtask, fields to copy, etc to create a subtask in the transition.
Please do check and let me know for any queries in it.
Cheers
Mone Dileep Kumar
I need to create the Sub-Task based on condition like
Thats why I need custom script post function
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.