Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Script Runner Groovy Expression: If parent issue subtasks are all resolved

NathanG
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 24, 2014

I'd like to be able to send a custom email notification when all the sub-tasks for an issue are marked "resolved" (resolution is not empty).

I know how to add a script runner post function - send custom email. But the sample conditions included in the send custom email function don't have any samples involving what I'm trying to do.

What is the right condition for this?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 24, 2014

Take a look at the

AllSubtasksResolvedCondition.groovy

NathanG
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 24, 2014

Where is that file located? I just searched for it on my server but I don't see it.

NathanG
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 24, 2014

Okay, I managed to look at the file via my web browser:

http://myjirainstancesecure/admin/groovy/CannedScriptSource.jspa?scriptURLStr=bundle://133.0:1/com/onresolve/jira/groovy/canned/workflow/conditions/AllSubtasksResolvedCondition.groovy

However, it seems way confusing... how do I implement this into a simple condition for whether I should send the email or not?

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 24, 2014

Here's your condition code:

import com.onresolve.jira.groovy.canned.workflow.conditions.AllSubtasksResolvedCondition;
def c = new AllSubtasksResolvedCondition();
def params = [
		(AllSubtasksResolvedCondition.FIELD_REQUIRED_RESOLUTION_ID):10000,
                'issue': issue      
        ]
c.doScript(params).passesCondition;

The ID you see in the code is the id of the resolution required for all subtasks.

TAGS
AUG Leaders

Atlassian Community Events