Skip to main content
Skip table of contents

Atlassian Jira Connector Operation Add Attachment

Input

  • Für diese Operation sind die Parameter hostkeyusername und password oder token erforderlich.

  • Die Datei, die angehängt werden soll, muss Base64-kodiert sein.
  • Es können auch mehrere Dateien gleichzeitig angehängt werden.

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

  • Wenn die Operation erfolgreich ausgeführt wurde, dann gibt der Adapter die globale Jira-ID des Anhangs aus.
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>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.