Before I start, my apologies if this seems a bit long-winded...
I need to create some testing sub-tasks with Approve/Reject actions to acknowledge testing in specific environments when an issue is ready for test. Once all sub-tasks have been done, it should move the parent issue to approved status or if any of the tests fail, the parent issue should be moved to a reject status and then back into development for fixing. My use case is actually similar to the use case discussed in the script runner documentation but am not quite able to understand the implementation as described here:
https://scriptrunner.adaptavist.com/4.3.5/jira/builtin-scripts.html#_create_a_sub_task
My workflow looks like:
image2016-10-27 11:13:31.png
And I am creating a transition step on pass testing but am kinda clueless how to go about adding Approve, Reject, Reopen steps in it...
image2016-10-27 11:11:49.png
When my sub-tasks get created, they all get set to an OPEN status initially. Just wondering how I can have the approve & reject options next to each sub-task rather than open status... What am I missing???
image2016-10-27 11:23:24.png
Ideally, I would like to see something like in the documentation:-
image2016-10-27 11:27:16.png
Looking for some how-tos please, if possible...
Thanks
Hi Anupam
If I understand right you want to create a subtask and immediately to tansit it to a status. So let's say that you want when the subtask with summary Run IST Testing get's created to immediately move through the Pass Testing transition then in the post function you have that creates the subtask Run IST Testing in the additional issue actions field add
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.IssueInputParameters import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.user.ApplicationUser import com.atlassian.jira.workflow.TransitionOptions doAfterCreate = { def cwdUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() def issueService = ComponentAccessor.getIssueService() IssueInputParameters issueInputParameters = issueService.newIssueInputParameters() issueInputParameters.setSkipScreenCheck(true) log.debug "I will transit the subtask " + issue.key def transitionOptions= new TransitionOptions.Builder() .skipConditions() .skipPermissions() .skipValidators() .build() // 21 is the id of the transition, in my example is the In Progress (21). Change it to fit your transition def transitionValidationResult = issueService.validateTransition(cwdUser, issue.id, 21, issueInputParameters, transitionOptions) if (transitionValidationResult.isValid()) { return issueService.transition(cwdUser, transitionValidationResult).getIssue() } log.error "Transition validation result: " + transitionValidationResult.errorCollection }
Please let me know if this does the trick
regards, Thanos
Hi Thanos,
Thanks for your response. I tried it out but it is still not working as expected. The subtasks should not stay open when the parent issue is done. Also, the problem is that for the sub tasks, I don't see the action Approve or Reject. It is still showing the transitions as per my workflow for Open Status - Please see attached screenshot.
image2016-10-27 16:42:54.png
image2016-10-27 16:43:10.png
image2016-10-27 17:3:9.png
The sub-tasks only need to have two transition actions. Approve and Reject.
What I am trying to do is as follows:
So in theory, it is similar to your documentation use case...
image2016-10-27 16:55:13.png
Notice how it has Approve & Reject actions. I am looking to implement the similar logic. I hope that helps understand my use case better.
Thanks
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Anupam.
So, there's a lot of layers to what you're after. I think I can get you over the immediate road blocks, though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.