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:
{
"id":"388132",
"attachment":
"SmartAttachmentBean
{source=AttachmentBean
{self='[https://tryg01.atlassian.net/rest/api/2/attachment/298653'](https://tryg01.atlassian.net/rest/api/2/attachment/298653%27), id=298653, filename='V center1_09.png',
author=UserBean
Can’t post it all or attach because I am a new user… sigh
The custom data configured as payload is:
{
"id": "{{issue.id}}",
"attachment": "{{issue.attachment.last}}"
}
The {{issue.id}} is nice and clean, but the attachment is another format.