Fetch the Component/s whose lead is a specific user
Abstract
This code snippet fetches the Component/s whose lead is a specific user.
Logic
Access the available options for the issue's Component/s, find all Component/s whose lead is the specific user and return them.
Snippet
def components = issue.getAvailableOptions("components") def newComponents = components.findAll{ it?.getLead() == <ApplicationUser Object> } return newComponents
Placeholders
Placeholder | Description | Example |
---|---|---|
> | The ApplicationUser object | currentUser() |
Context
The output of this snippet is a Collection<ProjectComponent>
which you can use in a Groovy expression for example, to set a Component/s field in:
- one of the Set Field Value post-functions
the Create issue post-function under Set fields of new issue section
References
Related articles