Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When the connection is configured and the URL endpoint is and API token are created, you can use the URL endpoint and API token to transfer attachments from the source cloud instance (where the app is installed) to the target cloud instance. You can use these credentials either through Jira automation, or your own app.

Jira automation

Create a Jira automation on the desired trigger (e.g. Issue created) with the “Send web request“ action. Use the generated URL endpoint for the “Web Request URL“. To authenticate your API requests, include an Authorization header in each request. The value of this header should be the API token generated from the API Tokens in the Settings. See the “Send web request“ action example below:

  • Web request URL

    • https://attachments-transfer-api.twinit.app/gateway/transferAttachments?id=aef469b5-34e5-4e16-942f-d3916d33b6b5

  • HTTP method

    • POST

  • Web request body

    • Custom data

Code Block
{
  "jql": "issuekey = ITSM-1",
  "sourceKey": "{{issue.key}}",
  "commentId": "{{issue.comment.id}}"
}
  • Headers

Key

Value

Accept

Application/JSON

Authorization

46f61f78-e138-4019-85a0-e239878f2c94

...

External application

Make a POST request with the generated URL endpoint. To authenticate your API requests, include an Authorization header in each request. The value of this header should be the API token generated from the API Tokens page. The sample request structure:

...

  • jql (string) - (Required): The JQL query to find target issues.

    • JQL has a limit of 10 issues per automation action!

  • sourceKey (string) - (Required): The key of the source issue.

  • commentId (string) - (Optional): The ID of the comment (if applicable).

...

  • )

...

  • Web request URL

    • https://attachments-transfer-api.twinit.app/gateway/transferAttachments?id=aef469b5-34e5-4e16-942f-d3916d33b6b5

  • HTTP method

    • POST

  • Web request body

    • Custom data

...

  • .

...

  • Headers

Key

Value

Accept

Application/JSON

Authorization

46f61f78-e138-4019-85a0-e239878f2c94

...

...

POST Request header

Code Block
curl -H 'Authorization: 46f61f78-e138-4019-85a0-e239878f2c94'

...