format a transition date

werner kolze September 9, 2015

hi all - 


I am attempting to grab a transition date and then display it in a different format

here is what I have

Version A: 

<!-- @@Formula:
import java.text.SimpleDateFormat;
dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:MM a");

String s = issueObject.issueTypeObject.name;

if (s.equals("enter_issue_type_name_here"))
{

  if (issue.get("customfield_15611")==null)
  {
     if (issue.get("customfield_16736") != null)
     {
       datecreated = issue.get("customfield_16736");
       dateFormat.format(datecreated);
     }

   }else
   {
      datecreated = issue.get("customfield_15611");
      dateFormat.format(datecreated);
   }
 if (datecreated != null)
 {
 dateFormat.format(datecreated);
 }
}
-->

 

Version B:

<!-- @@Formula: 
import java.text.SimpleDateFormat;
dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:MM a");

String s = issueObject.issueTypeObject.name;

if (s.equals("enter_issue_type_name_here"))

{

   if (issue.get("customfield_15611")==null)
   {
      if (issue.get("customfield_16736") != null)
       {

         datecreated = issue.get("customfield_16736");
         dateFormat.format(datecreated);
        }

   }else{
     datecreated = issue.get("customfield_15611");
     dateFormat.format(datecreated);
   }
}
-->

the "customfield_15611" does contain a date  - but I get nothing displayed on the screen.

any hints / tips / help / assistance be greatly appreciated

 

 

2 answers

0 votes
werner kolze September 10, 2015

I took the label off yesterday -

0 votes
Steven F Behnke
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 9, 2015

You have this Question labeled as 'Scriptrunner,' but the '!@@Formula...' syntax was part of the Misc Calculated Fields, wasn't it?

Suggest an answer

Log in or Sign up to answer