Is there a way to block a subtask transition based on both the parent issue type and the user role?
For example
If issue type is a subtask and parent issue type is STORY then disallow transition of subtasks from In Progress to DONE unless user has Project Role XYZ
If issue type is a subtask and parent issue type is TASK then allow transition of subtasks from In Progress to DONE if user has Project Role ABC
Edit: Had to fix my example.
You need to install JMWE to Jira Cloud in order to accomplish this. It cannot be done through the standard functionality.
You'll want to use the new condition "Linked Issues Condition (JMWE app)". You'll configure it like this:
You would then need to add a nested condition to ensure the user is in the correct user role.
You'd then build the second set of conditions for the task/other project role. In the end, it would look something like this:
You would click on the fork to build the nested conditions.
What this screenshot shows is that you need to meet 1 of the two conditions, but for each condition you need to meet all the nested conditions. So, a parent ticket of type "Story" you must be a developer to transition. OR your parent could be a task in which case you need to part of the service desk team.
Hope this helps!
Kian
EDIT: Updated Screenshots to reflect correct condition configuration.
In my case I want to set conditions on the subtask so wouldn't it be
Issue Link Type is a subtask of
Issue Type Story
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, because the link is checking based on the relationship to the current ticket. This would be a set of conditions on the subtask workflow.
Essentially, you are saying "If my parent is a story, you must be in project role X to transition me".
Does that make sense?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think my example in my original post may have been wrong. Here's what I meant to say
If issue type is a subtask and parent issue type is STORY then disallow transition of subtasks from In Progress to DONE unless user has Project Role XYZ
If issue type is a subtask and parent issue type is TASK then allow transition of subtasks from In Progress to DONE if user has Project Role ABC
Does that change this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
While Kian's approach with JMWE should work, it'd like to show off an alternative app, called Cloud Workflows, that you could use. It allows you to add conditions and validators based on Jira Expressions.
In case there are more issue types than just the sub-task in your workflow, you'll want to test for that first, which looks like this:
issue.issueType.name == "Sub-task"
Additionally, you want to ensure that the parent of the issue has a specific type, which can simply be added with the following:
issue.issueType.name == "Sub-task"
&& issue.parent.issueType.name == "Story"
So, you would create a Cloud Workflows custom condition with the above Jira Expression and combine that with a condition that checks a user's project role and you're done.
Hope that helps!
Full disclosure: I work for the Vendor who created Cloud Workflows. Let me know if you need any help getting started.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Michael,
I think I see the confusion. I made a mistake in the conditions I showed you earlier. They should look like this:
In addition, if you have other issue types that don't follow this behavior IE, subtasks of bugs should transition without limitation, you would need to add an additional condition onto the bottom.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmmm, I'm still having issues.
To clarify the questions. Only users with project Role "QA" can move a subtask linked to a Story to the workflow staged QA.
I've doublechecked a few things to make sure it wasn't human error.
1. I made sure the changed workflow was published.
2. I made sure I removed myself from the project rule QA.
3. I was still able to move a subtask linked to a Story to the QA.
I also made a dummy user account and tested in case me having site and jira admin was allowing me to bypass. Also, when I drag and drop the subtask to QA the column displays a "loading" very briefly so I know I'm targeting the right stage.
Here's the settings. Is there anything you can see that I did wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do I have to do anything else like assign this app to this project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
You usually do not have to assign an app to a project, certainly not with apps that add workflow features.
I suggest you try enabling all conditions one-by-one, so that you know which one does not work as expected. My hunch would be that the last one for some reason evaluates to true, thus allowing your issue to be transitioned to QA.
I'm not really sure how JMWE's injection of the linkedIssue works, but the more standard way to check a parent's issue type with a Jira Expression would be the one mentioned above. I'm pretty sure JMWE should allow that, too.
Hope that helps,
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Oliver Siebenmarck _Polymetis Apps_ Thank you. I installed Cloud Workflows and it seems to have gotten me almost to where I need to be.
I was successful in controlling the sub-tasks using this method. I have two groups of conditions based on whether the parent issue is Story or Task.
issue.issueType.name == "Sub-task" && issue.parent.issueType.name == "Story"
Where project role = "QA"
and also
issue.issueType.name == "Sub-task" && issue.parent.issueType.name == "Task"
Where project role = "Project Member"
Those two have successfully allowed me to control Sub-tasks based on the parent issue type.
Now I need to know how to apply the same condition to just the parent issue.
I tried this...
issue.issueType.name == "Task"
Where project role = "Project member"
But the QA status is still blocked. This seems to happen to Task types whether they have Sub-tasks or not.
I'm guessing the Jira expression I used is wrong.
Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I may have figured this out.
issue.issueType.name != "Story"
Where project role = "Project member"
Testing it now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Oliver Siebenmarck _Polymetis Apps_
I may have figured this out.
issue.issueType.name != "Story"
Where project role = "Project member"
Testing it now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sounds good, did you get it to work the way you want it to?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think so. I believe I understand the nuances enough now that I should be able to solve any future issues myself. Thanks for your help. I'll leave you a review.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Oliver Siebenmarck _Polymetis Apps_
Can I use an OR function in an expression. Something like this
issue.issueType.name == "Story" or "Epic"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Michael Arndt You totally can! The OR operator is || and it would look like this:
issue.issueType.name == "Story" || issue.issueType.name == "Epic"
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.