Versions Compared

Key

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

Abstract

This code snippet sets an Estimate field to the difference of two specific dates of the issue. 

...

The output of this snippet is a String representing an duration which you could use in :A a Groovy expression, for example to :

...

- Set an estimate field

...

. Eg: Set the Original estimate of the issue to the difference of the issue creation and Due date in

  • one of the Set Field Value post-functions
  • the Create issue post-function under Set fields of new issue section

    Conditionally execute a Post-function/Condition/Validator or Unlink issues  - Eg: Check that the difference in the issue creation and due date is less than 7 days

    Code Block
    languagegroovyjs
    linenumberstrue
    if(issue.get("duedate"))
    {
      return (issue.get("duedate") - issue.get("created") <= 7)
    }

A Groovy template, for example to:

    Notify the customer that the issue will be resolved in certain number of days through the
  • Comment in one of the Comment issue post-functions
  • Subject/HTML body/Text body of Email issue post-function

    Code Block
    languagegroovy
    linenumberstrue
    Your issue will be resolved in <%=if(issue.get("duedate"))
    {
      return issue.get("duedate") - issue.get("created")
    } %> days
  • Write a JQL search expression in Link issues to the current issue post-function. 
  • ) + "d"
    }


References

...