It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hello,
Here's my issue. I have a status 'Waiting for training date confirmation', within the status I have 5 transitions: Training Date confirmed, PDM approval, TDU approval, EU approval and Intl. approval.
status view.jpg
The approval transitions set the date value of a corresponding custom field. What I would like to do is automatically fire the transition 'Training date confirmed' to move the task to the next status after the other four transitions have been fired or validate that their corresponding fields are not empty.
transition post function.jpg
I am using the scripted 'Fast-Track transition an issue' postfunction
Condition:
issue.issueTypeObject.name == 'Feature Rollout'
Action: Training date confirmed
Additional Code:
(!cfValues['Training date PDM approval'].getValue().equals('') && !cfValues['Training date TDU approval'].getValue().equals('') && !cfValues['Training date EU approval'].getValue().equals('') && !cfValues['Training date Intl. approval'].getValue().equals(''))
I believe I need to def the custom fields but I'm not quite sure. Could you please point me in the right direction?
Postfunction.jpg
Also, I assume that I only need to place this post-function on the 'Training date confirmed' transition and not the others. Would that be correct?
Thank you!
Thanks Vasiliy,
I've removed the script from 'Additional Code' and moved it up to 'Condition' as suggested. I've also switched up the code here to CF value != null from everything I am reading this should have worked well.
New Code:
cfValues['Training date PDM approval']?.getValue() != null && cfValues['Training date TDU approval']?.getValue() != null && cfValues['Training date EU approval']?.getValue() != null && cfValues['Training date Intl. approval']?.getValue() != null
However, I am getting the following in the logs:
2016-02-01 13:14:32,449 ... ERROR ... /secure/WorkflowUIDispatcher.jspa [canned.jira.utils.ConditionUtils] Condition failed on issue: ABT-21, built-in script:com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition
groovy.lang.MissingMethodException: No signature of method: java.lang.String.getValue() is applicable for argument types: () values: []
Possible solutions: getClass(), getAt(groovy.lang.IntRange), getAt(groovy.lang.Range), getAt(groovy.lang.EmptyRange), getAt(java.lang.String), getAt(groovy.lang.IntRange)
at Script104.run(Script104.groovy:1)
2016-02-01 13:14:32,451... ERROR ... /secure/WorkflowUIDispatcher.jspa [canned.jira.utils.ConditionUtils] Script follows:
cfValues['Training date PDM approval']?.getValue() != null && cfValues['Training date TDU approval']?.getValue() != null && cfValues['Training date EU approval']?.getValue() != null && cfValues['Training date Intl. approval']?.getValue() != null
None of the possible solutions make sense. I've researched the error as well but still can't figure out where I am going wrong.
Hello Avril,
so your current Status is "'Waiting for training date confirmation'.
When you are transitioning to PDM approval you should check für the other three approvals and then fast Transition to Waiting for WebEx .
I'd write a ScriptRunner Script something along the line
def bool_all_approved// check Approvaldef cf_PDMapproval = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == ''Training date PDM approval'}def cf_TDUapproval = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == ''Training date TDU approval'}def cf_EUapproval = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == ''Training date EU approval'}def cf_INTapproval = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == ''Training date Intl. approval'}bool_all_approved = ( cf_PDMapproval != null && cf_TDUapproval != null && cf_EUapproval != null && cf_INTapproval != null )
Hope this helps, if I find the time, I'll try to improve this and code it in a test environment next week - if you can wait that long.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreAtlas Camp is our developer event which will take place in Barcelona, Spain from the 6th -7th of September . This is a great opportunity to meet other developers and get n...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.