Forums

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

How to get attachments on issue creation but NOT on transition

Bhanu Priya KS June 11, 2020

Hi,

 

I have an automation rule that is triggered when issue is created.I want to get the attachment names from the issue in the scriptrunner and based on the name, I want to later transition the issue to a different status.

How do I do this? I tried the below but the size is 0 although there are attachments.

def attachmentManager= ComponentAccessor.getAttachmentManager()
List attachments = attachmentManager.getAttachments(issue)

log.warn( "Attachment List Size "+attachments.size())

Any help is highly appreciated.

 

1 answer

0 votes
Tomasz Bryła
Contributor
June 12, 2020

Hi @Bhanu Priya KS,

You can use ScriptRunner Listener instead of post function in Create transition. 

https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_fast_track_transition_an_issue

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events