Remove flag from parent issue!

Davor Fisher December 23, 2015

Hey everyone,

We have a post function set up that when a defect sub-task is transition into a status "in refinement" the parent issue (story) will automatically get flagged; we are using this post function on the transition "to in refinement"

Post function in Copy a parsed text to a field function

Taget Field: Parents flagged - %{00016} = "In Refinement" ? "Impediment" : ""


What we now need is a post function that when a defect sub-task is transition from in refinement to any other status that the flag is automatically taken off the parent issue (story) 

 

Thanks

2 answers

1 accepted

0 votes
Answer accepted
Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 23, 2015

In addition to the comment from @Bob Swift [Bob Swift Atlassian Add-ons] I would also think about the edge case where you had two defect subtasks which would have caused the parent issue to be flagged. Do you still want to clear the parent if only one defect has moved to "In Refinement"?

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 24, 2015

Good point, if so, then you would add another condition to the post function using JQL to check if there were any other subtasks not in that state. Condition on the JQLresult (%jql_result_count%) being 0.

Jacob Rasmussen June 13, 2016

Hi @Bob Swift [Bob Swift Atlassian Add-ons]
Maybe you can help me creating the correct expression for a conditional Execution of a post function?

My workflow is
To Do --> In Progress --> Impeded --> Done

I have made following post functions on transitions TO "Impeded"
1. Set Flagged to "impediment" 
2. Copies value of Flaggeed to parent issue replacing existing values

Post functions on transitions FROM Impeded
1. Clears Flagged
2. Copies Value of Flagged to parent issue replacing existing values

All seems to be working fine however:
I want a condition on post function number 2, so that the flag on parent issue will NOT be cleared if the parent issue have other subtask(s) with Status = Impeded.

I have no experience in groove expression :(

I hope you can help me figuring this out as this is the last step of setting up my workflow.

/Jacob

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 13, 2016

For post function #2, if you need to condition ONLY on the clearing flag and not the other, then you need to split the post function into 2 parts. The you condition the first part based on the JQL result returning 0 entries as mentioned above. So you would use Update issues post function with your condition and JQL query. It would simply set the Flagged custom field value to blank.

More specifically:

Condition 1: %jql_result_count%, Regex pattern: 0

 

1 vote
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 23, 2015

The Update issues post function from Update on Transition for JIRA can be used to set any custom field including Flagged. The issue to update would be %parent_key% (substitution variable), You can condition the update based on the issue type - see How to use pattern matching conditioning

Suggest an answer

Log in or Sign up to answer