---
title: "Getting the current user - Groovy"
canonical: "https://support.appfire.com/space/JMWE/461930944/Getting%20the%20current%20user%20-%20Groovy"
format: markdown
---
> Macro (aura-html)

### Abstract

<span style="color: #333333">This code snippet </span><span style="color: #333333">fetches th</span>e user who triggered the current transition.

### Logic

This snippet uses the [currentUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461799437) built-in variable to fetch the ApplicationUser object representing the user who triggered the current transition.

### Snippet 

```javascript
currentUser
```


### Examples

The output of this code snippet is an [ApplicationUser](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599) object representing the current user which you could use in:

**A Groovy template, for example to:**

- Set a user picker field to the current user. Eg: Save the user who "coded" an issue into an "Implemented by" custom User Picker field for traceability and reporting purposes or Assign an issue to the current user in
  - one of the Set Field Value post-functions
  - the Create issue post-function under Set fields of new issue section
- <span style="color: #333333">Conditionally execute a Post-function/Condition/Validator or Unlink issues  - Eg: Check that the current user is the Reporter of the issue</span>

**A Groovy template, for example to:**

- <span style="color: #333333">Notify the customer that the issue raised by them is being handled by the current user through the</span>
  - Comment in one of the Comment issue post-functions
  - Subject/HTML body/Text body of Email issue post-function
- Write a JQL search expression in the Link issues to current issue post-function - Eg: Link issues assigned to the current user

### References

- [currentUser variable](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461799437)
- [ApplicationUser interface](https://appfire.atlassian.net/wiki/spaces/JMWE/pages/461472599)
- [**Groovy Documentation**](http://groovy.codehaus.org/User+Guide)

### Related articles

> Macro (contentbylabel)

> Macro (details)
> 
> | **Related issues** |  |
> | --- | --- |