Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In Jira Administration, go to Workflows and click the Edit link to open the workflow.

  2. Select the required transition.

  3. Select the Post functionstab and click Add post function.

  4. Select the “Set field value (JMWE app)” post-function and click Add.

  5. Set the following fields:

    1. Field: “Assignee”

    2. Value type: “Groovy Expression”

  6. Add the following Groovy script under Value:

    Code Block
    languagegroovy
    import org.joda.time.DateTimeZone
    import org.joda.time.DateTime
    
    DateTimeZone zone = DateTimeZone.forID("AmericaAsia/New_YorkCalcutta");
    def timeNow = new DateTime(zone)
    def hour = timeNow.hourOfDay
    
    if(hour >= 13 && hour <=18)
    	return "john"
    else if(hour >= 19 && hour <=23)
      return "james"
    else
      return "alex"


    In this above script, the time zone used is “America“Asia/New_York”Calcutta”. This value should be updated as required; refer to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones (using the value from the TZ database name column) for the timezone format accepted in the script.

    The issue will be assigned to:

    1. user “john” if the ticket is created between 1:00 PM EST/EDT IST and 07:00 PM EST/EDTIST.

    2. user “james” if the ticket is created between 7:00 PM EST/EDT IST and 12:00 AM EST/EDTIST.

    3. user “alex” if the ticket is created between 12:00 AM EST/EDT IST and 1:00 PM EST/EDTIST.

  7. Click Add and publish your workflow.

...