Create issue using ScriptRunner Jobs with current month in Summary

Kristin Lyons
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.
September 13, 2023

Is it possible to create an issue using ScriptRunner's Jobs that sets a specific set of text as the summary along with the current month that the script runs?

 

Example:

 

"Set Release for ((September))"

2 answers

1 accepted

1 vote
Answer accepted
Ram Kumar Aravindakshan _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.
September 14, 2023

Hi @Kristin Lyons

For your requirement, I suggest using the Escalation Service.

Below is a sample working code for your reference:-

import java.time.LocalDate

def currentdate = LocalDate.now()

def currentMonth = currentdate.month

def existingSummary = issue.summary

issue.update {
setSummary("${existingSummary} ${currentMonth.toString()}")
}

Please note that the sample working code above is not 100% exact to your environment. Hence, you will need to make the required modifications.

If you observe in the example code above, I have used a simplified approach via ScriptRunner's HAPI to update the issue instead of using the Issue Manager. 

Below is a screenshot of the Escalated Service configuration:-

escalation_service.png

I am also including a couple of test screenshots to display the Issue's summary before and after the Escalation Service has been triggered:-

1. Before the Escalation Service is triggered

before.png

2. After the Escalation Service has triggered

after.png

 

I hope this helps to solve your question. :-)

Thank you and Kind regards,

Ram

Ram Kumar Aravindakshan _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.
September 18, 2023

Hi @Kristin Lyons

Has your question been answered?

If yes, kindly accept this answer.

Thank you and Kind regards,

Ram

0 votes
Hauke Bruno Wollentin
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.
September 14, 2023

Yes, to get the current month you can use something like

import java.time.LocalDateTime

def now = LocalDateTime.now()

def month = now.getMonth().toString()

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.14
TAGS
AUG Leaders

Atlassian Community Events