How can I make a simple custom field with the month only in MM format?

I know this should be a simple task but I can't seem to figure out how to create a custom field that displays the month only in MM format when a ticket gets closed, we are trying to set this up for Barchart reporting. Any help would be greatly appreciated.

3 answers

1 accepted

0 votes
Renjith Pillai Community Champion Feb 01, 2013

I would simply install the script runner plugin, add a scripted field and add this code.

import java.text.SimpleDateFormat;
return new SimpleDateFormat("MM").format(new Date(issue.getResolutionDate().getTime()))

How about a select list custom field with all the months as the list of selections? They come with JIRA, so you dont have to write your own.

I'm trying to make it so it's automatic, ultimately it would be great to get the MM value from the system field "End dat / time" but it really doesn't matter where it comes from, I just need it to be automatic. Thanks for the suggestion though

1/ Create a read-only CF.

2/ Fill it using some scripting on a listener (or craete your own listener), postfunction or whatever (depends on your wf, screens, etc)

Edit: check if this calculated CF may help you.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,760 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot