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: 

Help converting Groovy to Nunjucks

Russell Dersley
October 26, 2022

We have some workflows from our Jira server using the JMWE app that have some groovy expressions in them written by someone who has since left.

 

After migrating to the cloud we now need to convert these to Nunjucks or Jira expression - would anyone have an idea how this would look in Jira - its a simple number generator

Calendar.getInstance().get(Calendar.YEAR)+'-RIM-' +
issue.get("issuekey").split("-")[1] + '-' +
Math.abs(new Random().nextInt() % 6000) + 1;

 

Thanks

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
David Fischer
Community Champion
October 26, 2022

Hi @Russell Dersley ,

You can try something like this:

{{now | date( "YYYY" )}}-RIM-{{issue.key.replace(r/[^\-]+-/,"")}}-{{range(0,5)|random}}{{range(1,999)|random}}
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events