Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

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
PlaceholderDescriptionExample
<ApplicationUser Object>The ApplicationUser objectcurrentUser()

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