Month Year Custom field

Hi All,

Is there a plugin in Jira which provides month year picker field, it will display the value something like this July 2013.

OR

how could we pick month and year from date picker field and display the result in a read only field?

If anyone could provide me an example of the same that would be very helpful.

Thanks and Regards,

Jenin C M

3 answers

1 accepted

This widget could not be displayed.

Thanks all, I have achieved this via Calculated Custom Field.

Jenin

This widget could not be displayed.
Timothy Chin Community Champion Sep 22, 2013

Well, the shoddy way is to create two select lists. One for month and one for year. To make it read only, only show the field in specific screens.

This widget could not be displayed.

you can do this with the help of following code

Timestamp committedDate = (Timestamp)issue.getCustomFieldValue(cfm.getCustomFieldObjectByName("Committed Date"));
	    System.out.println(committedDate+" current committed date value");
	    if(committedDate!=null)
	    {
	    	System.out.println(new SimpleDateFormat("MMMM").format(committedDate)+"    month details 22");  
	    	System.out.println(new SimpleDateFormat("yyyy").format(committedDate)+"    year details 22");  
	    	issue.setCustomFieldValue(cfm.getCustomFieldObjectByName("MonYear"),new SimpleDateFormat("MMMM").format(committedDate)+" "+new SimpleDateFormat("yyyy").format(committedDate));
	    }
	    try
		{	
        	IssueManager issueManager4=comAcc.getIssueManager();
            
		    issueManager4.updateIssue(authenticationContext.getLoggedInUser(),issue,EventDispatchOption.ISSUE_UPDATED,true);
		    
		    comAcc.getIssueIndexManager().reIndex(issue);
		}
        catch(Exception e)
        {
        	e.printStackTrace(); 
		}

here Committed Date is of Date Picker type and MonYear is of Read Only Text Field.

you can place this in listener which catch for ISSUE_CREATED and ISSUE_UPDATED events.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 8 hours ago in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

26 views 1 2
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