Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set a component using script runner ?

Ruban Jayathas June 22, 2016

I am setting up a listener which on issue updated and component = some component has to create a clone of the issue in another project.

I would like to know how I can define the component in the script.

2 answers

1 accepted

1 vote
Answer accepted
adammarkham
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2016

Your condition for the listener should be something like:

issue.componentObjects.any { component ->
    component.name == "Expected Component"
}
0 votes
Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 22, 2016

You can get all project components like that:

for(ProjectComponent component: project.getProjectComponents()){

}
Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 22, 2016
project = issue.getProjectObject()

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events