Send latest attachment with webhook + what is the format of the POST when using smart value

With a project webhook, I want to send the latest attachment using the smart value {{issue.attachment.last}}.

This works, though the {{issue.attachment.last}} sends the latest in the list, not the latest added…! But I think I have found a work-around for this.

My colleague on the other side (Jira Spoke in ServiceNow), needs to parse and map this to the attachment field in SN. But: the format of the smartvalue inside the JSON load is not valid JSON. The {{issue.attachment.last}} is in a Bean format.

The payload sent from Jira is as follows:

{self='['](, id=298653, filename='V center1_09.png', 

Can’t post it all or attach because I am a new user… sigh

The custom data configured as payload is:

"id": "{{}}",
"attachment": "{{issue.attachment.last}}" 

The {{}} is nice and clean, but the attachment is another format.


Thanks for reaching out. Unfortunately there isn’t really an easy elegant way to convert the bean into a json parsable format. You would need to manually specify the fields in the payload you are sending, ie

"id": "{{}}",
"attachment": {
  "id": "{{}}",
  "filename": "{{issue.attachment.last.filename}}",
  "size": "{{issue.attachment.last.size}}",

Apologies for the inconvenience, I have raised an improvement ticket for this here [AUT-2383] - Code Barrel JIRA


Thanks Sam. And thanks for raising an improvement issue.

Can you provide an answer on how to retrieve the latest added attachment on an issue? attacment.last is not enough.

And: is there a possibility to include the link to the attachment in Jira? Otherwise it cannot be retrieved by another system.

Br, Kristoffer