Atlassian Jira Connector Operation Add Attachment
Input
This operation requires the
host,key,usernameandpasswordortokenparameters.The file to be attached must be Base64 encoded.
Several files can also be attached at the same time.
Add Attachment
CODE
<?xml version="1.0" encoding="UTF-8"?>
<RootElement>
<attachments>
<attachment>
<fileName>test.txt</fileName>
<fileData>SGFsbG8gV2VsdCEhIQ==</fileData>
</attachment>
<attachment>
<fileName>test.xml</fileName>
<fileData>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxyb290Pg0KPHRlc3Q+SGFsbG8gV2VsdCE8L3Rlc3Q+DQo8L3Jvb3Q+</fileData>
</attachment>
</attachments>
</RootElement>
Output
If the operation was performed successfully, then the adapter outputs the global Jira ID of the attachment.
XML
<?xml version="1.0" encoding="UTF-8"?>
<JSON>
<e>
<self>https://jira.example.de/rest/api/2/attachment/57798</self>
<id>57798</id>
<filename>test.txt</filename>
<author>
<self>https://jira.example.de/rest/api/2/user?username=x4solution.center</self>
<name>x4solution.center</name>
<key>JIRAUSER12810</key>
<emailAddress>x4solution.center@example.de</emailAddress>
<avatarUrls>
<_48x48>https://jira.example.de/secure/useravatar?ownerId=JIRAUSER12810&avatarId=14718</_48x48>
<_24x24>https://jira.example.de/secure/useravatar?size=small&ownerId=JIRAUSER12810&avatarId=14718</_24x24>
<_16x16>https://jira.example.de/secure/useravatar?size=xsmall&ownerId=JIRAUSER12810&avatarId=14718</_16x16>
<_32x32>https://jira.example.de/secure/useravatar?size=medium&ownerId=JIRAUSER12810&avatarId=14718</_32x32>
</avatarUrls>
<displayName>X4 Solution Center</displayName>
<active>true</active>
<timeZone>Europe/Berlin</timeZone>
</author>
<created>2021-02-05T14:48:09.864+0100</created>
<size>13</size>
<content>https://jira.example.de/secure/attachment/57798/test.txt</content>
</e>
<e>
<self>https://jira.example.de/rest/api/2/attachment/57799</self>
<id>57799</id>
<filename>test.xml</filename>
<author>
<self>https://jira.example.de/rest/api/2/user?username=x4solution.center</self>
<name>x4solution.center</name>
<key>JIRAUSER12810</key>
<emailAddress>x4solution.center@example.de</emailAddress>
<avatarUrls>
<_48x48>https://jira.example.de/secure/useravatar?ownerId=JIRAUSER12810&avatarId=14718</_48x48>
<_24x24>https://jira.example.de/secure/useravatar?size=small&ownerId=JIRAUSER12810&avatarId=14718</_24x24>
<_16x16>https://jira.example.de/secure/useravatar?size=xsmall&ownerId=JIRAUSER12810&avatarId=14718</_16x16>
<_32x32>https://jira.example.de/secure/useravatar?size=medium&ownerId=JIRAUSER12810&avatarId=14718</_32x32>
</avatarUrls>
<displayName>X4 Solution Center</displayName>
<active>true</active>
<timeZone>Europe/Berlin</timeZone>
</author>
<created>2021-02-05T14:48:09.867+0100</created>
<size>81</size>
<content>https://jira.example.de/secure/attachment/57799/test.xml</content>
</e>
</JSON>