I have 2 workflows: Capability_WF and Feature_WF.
There are two issues F1 and F2 associated to Feature_WF and one issue C1 associated to Capability_WF , where F1, F2 are child of C1.
So when
1) F1 status moves to COMMITTED, F2 status moves to PARTIAL COMMITTED---> C1 status should move to PARTIAL COMMITTED (because both the child f1 n f2 are not committed yet)
2) F1 status moves to COMMITTED, F2 status moves to COMMITTED---> C1 status should move to COMMITTED.
I have written a condition in the post function of Feature_WF's transition which should move C1 to COMMITTED issue_type when below is run.
issue.getAsString("Issue Type")=="Feature" && issue.getAsString("Status")=="COMMITTED"
but its not working, this part of the above condition issue.getAsString("Status")=="COMMITTED" returns false even when the issue status is COMMITTED.
What am I missing, can somebody help me with this?
Thanks in Advance
There is no method "getAsString("")" in issue. Check the API docs https://docs.atlassian.com/software/jira/docs/api/7.1.2/com/atlassian/jira/issue/Issue.html#getStatus--
It should look like this
issue.issueType.name=="Feature" && issue.status.name =="COMMITTED"
You can also use like this "issue.getStatus().getName()" instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
issue.issueType.name=="Feature" && issue.status.name =="COMMITTED" also returns false
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you using Script Runner?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not really, I'm adding these conditions in Post function-> Conditional execution section
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well then it won't work there because the plugin you are using doesnt know what is "issue". I assumed you are using Script Runner where "issue" has binding with current issue object.
I am not sure how to test the script there. But you can use IssueManager like this to get current issue object .
import com.atlassian.jira.component.ComponentAccessor;
def issueManager = ComponentAccessor.getIssueManager();
def issue = issueManager.getIssueObject("ABC-100");
then you can use "issue" object further. But its only for testing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the update.. Actually its recognizing issue because the condition issue.issueType.name=="Feature_design" returns true
but issue.status.name =="COMMITTED" returns false and
issue.status.name !="COMMITTED" returns true , somehow its not able to pick that status.
Regarding scriptrunner I'm not sure how to link the script there with my post function? I need to run the post function when my condition is true.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which postfunction are you using? You need to write custom script post function which will perform the transition upon meeting the condition. So you need to put the condition in IF loop and the perform the transition using more groovy code. using issueService API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
issue.status.name !="COMMITTED" that means the issue is not in the status "Committed". Check the exact names of the issue type and statuses.
issue.issueType.name=="Feature_design" returns true, check the issueType and status names of current issue correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try issue.getStatusObject().getName() to get the status.
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.
:D
Which plugin are we talking about? Sorry, I assumed Script runner but apparently I was wrong :)
It might be best to contact your plugins support team for the specific syntax.
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.