Hey all,
just wanted to ask a short question. I have a "Create Subtask" Action added to the transition. In the condition field I want to ask for the parent object issue type because I want the action to be executed exclusively for a specific issue type.
Thank you in advance and kind regards
Gerhard
This will give you the value of parent issue type:
issue.getParentObject().getIssueTypeObject().getName()
Hi @Gerhard Degel ,
If you expand the examples you should have what you are asking for (and maybe some other useful ones for later) :
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Antoine Berry just to confirm, the issuetype here is of the subtask correct? not the parent?
I'm trying to transition the parent only if the parent is a issuetype of 'Test'. I'm using the following, but it isn't working.
issue.parentObject.getIssueTypeObject().name == 'Test'
When I put logging in, it appears that I have it correct.
2021-07-01 18:40:53,893 DEBUG [runner.ScriptBindingsManager]: issuetype of parent is Test 2021-07-01 18:40:53,894 DEBUG [runner.ScriptBindingsManager]: status of parent is Retest
But it isn't changing the parent status. I'm not sure how to debug that because it is a delivered post function.
I'm not a developer and would love your thoughts.
Thanks!
Laurie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @LaurieC ,
the test condition
issue.parentObject.getIssueTypeObject().name == 'Test'
indeed tests against the parent issue type, so the condition will be true if the name of the parent subtask is "Test".
But what you are trying to achieve is a bit confusing so if you could add some insights that would help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks so much for responding @Antoine Berry
I have an issuetype called "Test". I have a subtask called "Test Step" that allows me to build out the steps in a test scenario. When all of the Test Steps are passed, the parent Test issue type will be automatically passed using the "Transition parent when all subtasks are resolved" built in script. I don't need a condition on that one.
If, during the testing process, someone finds a problem and an action needs to be taken before all Test Steps can be completed, they can track that action using a generic subtask. If all of the generic subtasks are resolved and all of the Test Steps are resolved, I want the parent Test issue type to move to pass as well. But I don't want that same functionality for other parent issue types - therefore, I want a condition on the post function that will only run if the parent is a "Test" issue type. Does that make sense?
I tried putting the above condition in, but it doesn't seem to be working.
Any thoughts? Or am I think about this incorrectly?
Thanks again for your time!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @LaurieC ,
First, I am very sorry for the late answer. I have tried your exact scenario and made it work. I suspect you have a recent version of Jira that makes one of the deprecated methods fail.
Could you please try instead :
issue.parentObject.issueType.name == 'Test'
Make sure you add this postfunction on the resolve transition of the sub-task workflow, and that the correct parent transition is selected :
Let me know how that went.
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gerhard Degel ,
This link is useful: https://docs.atlassian.com/software/jira/docs/api/7.2.2/com/atlassian/jira/issue/Issue.html
B.R.
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.