Versions Compared

Key

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

Abstract

This code snippet fetches the user who triggered the current transition.

Logic

This snippet uses the currentUser built-in variable to fetch the user object representing the user who triggered the current transition.

Snippet 

Code Block
languagejs
linenumberstrue
{{ currentUser }}

...

  • Set a User picker field to the current user. Eg: Assign the issue to current user in one of the Set Field Value post-functions, using the "Treat value as JSON" option
  • Set a User picker field to the current user in:
    • one of the Transition issue post-functions on the transition screen, if any
    • in the Create issue post-function under Set fields of new issue section

      Code Block
      {{ currentUser.nameaccountId }}


  • Conditionally execute a post-function or Unlink issues - Eg: Check that the current user is the Reporter of the issue 

    Code Block
    {{ currentUser.nameaccountId == issue.fields.reporter.nameaccountId }}


  • Notify the customer that the issue raised by them is being handled by the current user through the
    • Comment in one of the Comment issue post-functions
    • Subject/HTML body/Text body of Email issue post-function

      Code Block
      Hi {{ issue.fields.reporter.nameaccountId }}. Your issue is being handled by {{ currentUser.nameaccountId }}.


  • Write a JQL search expression in the Link issues to current issue post-function - Eg: Link issues assigned to the current user

    Code Block
    assignee = {{ currentUser.nameaccountId }}


References

...