Versions Compared

Key

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

Table of Contents

...

Panel
  • Add the Set field value to constant or Groovy expressionpost-function to the transition.
  • Select the Original Estimate field.
  • Select Groovy expression in the Value type.
  • Write the either of the content in the Value section.

    Code Block
    languagegroovy
    linenumberstrue
    if(issue?.get("duedate"))
    {
      Long days = issue?.get("duedate") - issue.get("created")
      return (days*8*60*60)
    }


    Code Block
    languagegroovy
    linenumberstrue
    if(issue?.get("duedate"))
    {
      return issue?.get("duedate") - issue.get("created") + "d"
    }


Set the priority of the issue to Highest if the issue belongs to the "Customer Portal" component

Panel
  • Add the Set field value to constant or Groovy expressionpost-function to the Create transition of the issue workflow.
  • Select the Priority field.
  • Select Groovy expression in the Value type.
  • Write Highest in the Value section.

  • Select the Conditional execution and write the following content:

    Code Block
    languagegroovy
    linenumberstrue
    issue.get("components")?.first()?.getName() == "Customer Portal"


  • Place the post-function after the Creates issue originally built-in post-function.

On the creation of a Story, change its priority to that of the Epic if the Epic's priority is lower than the current priority of the Story.

Panel
  • Add the Set field value to constant or Groovy expressionpost-function to the Create transition of the Story workflow.
  • Select the Priority field.
  • Select Groovy expression in the Value type.
  • Write the following content in the Value section.

    Code Block
    languagegroovy
    linenumberstrue
    if (issue?.getEpic()?.get("priority")?.getName() <= issue.get("priority").getName())
    {
      return issue?.getEpic()?.get("priority")
    }


  • Select Ignore empty value option

  • Place the post-function after the Creates issues originally built-in post-function.

Assign a reopened issue to the last person who commented it

Panel
  • Add the Set field value to constant or Groovy expressionpost-function to the Reopen transition of the issue workflow.
  • Select the Assignee field.
  • Select Groovy expression in the Value type.
  • Write the following content in the Value section.

    Code Block
    languagegroovy
    linenumberstrue
    def comments = issue.get("comment")
    if(comments)
    {
      return comments.last().getAuthorApplicationUser()
    }


...

Panel
  • Add the Set field value to constant or Groovy expressionpost-function to the Create transition of the issue workflow.
  • Select the Watchers field.
  • Select Groovy expression in the Value type.
  • Select Add source value(s) to destination field option
  • Write the following content in the Value section.

    Code Block
    languagegroovy
    linenumberstrue
    issue.getEpic()?.get("reporter")


  • Place the post-function after the Creates issue originally built-in post-function.

Epic has a Story and the task has a sub-task. When the sub-task is reopened we create a bug in another project linking it to the sub-task. On creation of the Bug, set the Epic link field value to the same field of the Task

Panel
  • Add the Create/Clone issuepost-function to the Reopen transition of the sub-task workflow.
  • Select the project from Project
  • Select the Bug in Issue type
  • Select is caused by in Link to new issue
  • Select the Epic Link field in Set fields of new issue.
  • Select Set field value from Groovy.
  • Write the following content in the Value section.

    Code Block
    languagegroovy
    linenumberstrue
    if(issue.getLinkedIssues("is caused by"))
    {
      issue.getLinkedIssues("is caused by").first().getParentObject().get("Epic Link")
    }



Copy

...

Jira service desk customers in a multi-user picker field to Request Participants ignoring the reporter of the issue

Panel
  • Add the Set field value to constant or Groovy expressionpost-function to the transition of the issue workflow.
  • Select the Request Participants field.
  • Select Groovy expression in the Value type.
  • Write the following content in the Value section.

    Code Block
    languagegroovy
    linenumberstrue
    def newUsers = issue.get("MUP").findAll{
      it.getName() != issue.get("reporter").getName()
    }
    return newUsers


Auto select the installation tasks in a Task checklist after the Installations are done

Panel
  • Add the Set field value to constant or Groovy expressionpost-function to the transition that leads to Installations complete status
  • Select the Tasks checklist field.
  • Select Groovy expression in the Value type.
  • Write the following content in the Value section.

    Code Block
    languagegroovy
    linenumberstrue
    return issue.getAvailableOptions("Tasks checklist").findAll{
      it.getValue().contains("Installation")
    }


...