The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I comment on a Parent issue as part of a Post-Function of the Subtask?

Steven F Behnke
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 Champions.
April 5, 2015

I am of course specifically referring to Script Runner.

I've seen lots of examples for looking at subtasks, and many examples of commenting on linked issues. I haven't seen a great example of accessing the parent issue and setting a comment there.

Use case
  1. I have a multi approval workflow using conditions and post-functions, as well as multi-user picker fields
  2. When the subtask is fully approved by all approval steps and people, this indicates a change in the parent issue.
  3. The parent issue should receive a comment along the lines of, "Change Request CR-1211 has been approved. Requirements may have changed."

Specifically, the issue has a Closed status and Close Issue transition. Ideally, the event fires as a post-function of Close Issue.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
JamieA
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 Champions.
April 7, 2015

It's the same as any of the other examples for commenting on an issue, but you will pass to commentManager.create: issue.parentIssueObject instead of just "issue".

Steven F Behnke
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 Champions.
April 7, 2015

I'll scope it out, I think that was my issue, I didn't know how to access the parent object.