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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,110
Community Members
 
Community Events
184
Community Groups

How to auto populate custom field(text) based on another custom field(checkbox) using script runner

I am trying to run an extract to provide an off-site team just the latest comments on a JIRA ticket if the ticket has a comment.  Is there a way to auto-populate the latest comment with the last comment on the Jira ticket.

 

1 answer

1 accepted

0 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 26, 2019 • edited

Hi Mindy,

Thank you for your question.

I can confirm that to achieve your requirement inside ScriptRunner for Jira Cloud that your script would need to make a call to the Get Comments API to get all the comments from an issue and then to extract the last comment from all the comments returned for that issue and to save this to a variable.

Your script would then need to make a call to the Add Comment API in order to post a comment onto with the issue with the last comment which you have saved inside of the variable.

Alternatively, you could update a multi-line text field on the issue to store the comment value which you have saved in a variable by making a call to the Issue API and I can confirm that we have an example of how to update an issue inside of the documentation page here.

If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.

Regards,

Kristian

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events