We are currently developing script listners for integration between Jira tickets and ServiceNow tickets.
What we would like to do is that the attachement files are uploaded to Jira tickets, then automatically send them to ServiceNow tickets.
Basically, we can do it that the files uploaded to Jira are sent to ServiceNow via ServiceNow API.
But we faced the problem that if we upload the multiple files at once, then they are sent to ServiceNow multiple times because the script listner run as many times as the amount of uploaeded file at once.
(ex. if we upload 3 files at once, then script listner run 3 times.)
the script run if “Issue Updated“.
Welcome to the Atlassian Community!
I think you have answered your own question - if you upload 3 files, the script runs 3 times.
My guess would be that your script has been coded to copy all attachments to your ServiceNow system, not just the one that was uploaded on this run. When attachment events are close together, this will lead to many copies of the files being sent to ServiceNow, because the script is uploading everything attached, mostly after the attachments have been successfully attached.
I think your script probably needs to look at the "file attached" event more closely - extracting the single file that was attached and only sending that to ServiceNow, rather than "all attachments"
Thank you for suggestion!
I tried to modify script to run when "file attached" as you suggested, I couldn't get issue_id of JIRA ticket. The event "file attached"(actually it's "attachement created" event) includes only timestamp and the type of webhook event and can't specify ticket key as follwing.
"webhookEvent": "attachment_created", "timestamp": 1689218648027
Do you have any suggestion to get ticket key if we use "attachment created" event?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you need to be looking at the script's triggers and code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.