Is there a way to auto populate text in a comment screen that pops up on transition?

Eric Blumberg February 18, 2019

I have a transition that when executes, it prompts a blank comment screen to come up and force the user to leave a comment. Is there a way to Pre-populate comment screen with "Approved by {USER} ON {TIMESTAMP}" (ex: Approved By John Smith on 1/25/19 1:05PM

1 answer

1 accepted

0 votes
Answer accepted
Patrick Cartier [Candylio]
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.
February 18, 2019

You can definitely get this done with Automation for Jira using the trigger for when the issue is transitioned, edit issue function, and smart values. 

Doesn't the issue history record the approver and time of approval if you use the approval function, though?  I might be wrong about this but it's what I remembered.

Eric Blumberg February 18, 2019

I should clarify, we are not using the service desk, I am just naming the transition approved. 

Is there a way to achieve this with scriptrunner, or just within JIRA?

Patrick Cartier [Candylio]
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.
February 18, 2019

With Scriptrunner you could follow something from this post:

https://community.atlassian.com/t5/Jira-questions/Groovy-post-function-create-add-comment-with-custom-field-value/qaq-p/305477

Have a post function for that transition that adds the assignee and date.  Pretty sure you can add some text in there too.

Eric Blumberg February 18, 2019

Thanks for the fantastically quick reply.

 

I looked into the link, but I am not sure how I would get this configured in the cloud version of scriptrunner.

Patrick Cartier [Candylio]
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.
February 18, 2019

In the adaptavist library (you'll need to create a username) there's this code:

 https://library.adaptavist.com/entity/update-the-value-of-a-custom-field-in-jira

You could use similar code to this as a scripted post function.

Eric Blumberg February 25, 2019

This is not quite what I am looking for. 

 

DO i need to go through all this still if I would settle for the same static text string on every comment?

Patrick Cartier [Candylio]
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.
February 25, 2019
Eric Blumberg February 25, 2019

This is what I was looking for. Thanks man!

Andrej Kováč March 14, 2024

Hello @Patrick Cartier [Candylio] , @Eric Blumberg ,

I am looking for exactly the same "hack" and unfortunately, the link provided is no longer valid. Could you by any chance remember and tell me how this is done?

Thanks!

Suggest an answer

Log in or Sign up to answer