Atlassian: Get attachment metadata
Atlassian issueAttachments.getAttachment: arguments, response, policy and SDK examples.
← Issue attachments operations · Get started
Operation atlassian.getattachment
Provider route: GET /{cloudId}/rest/api/3/attachment/{id}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/atlassian with npm, or alter-sdk-atlassian with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { AtlassianIntegration } from "@alter-ai/atlassian";
async function execute(input: Parameters<AtlassianIntegration["issueAttachments"]["getAttachment"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new AtlassianIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.issueAttachments.getAttachment(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_atlassian import AtlassianIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = AtlassianIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.issue_attachments.get_attachment(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.cloudId | string | Required within parent | Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
path.id | string | Required within parent |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get attachment metadata — response body |
Referenced models: Get attachment metadata — response body
Schemas
Section titled “Schemas”4 more schemas are linked from the tables above, on the schema pages.
Get attachment metadata — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Metadata for an issue attachment. |
author | JSON | Optional | |
author (anyOf 1) | Model | Alternative | Expand Get user — response body Details of the user who attached the file. Read only: true |
author (anyOf 2) | null | Alternative | |
content | JSON | Optional | |
content (anyOf 1) | string | Alternative | The URL of the attachment. Read only: true |
content (anyOf 2) | null | Alternative | |
created | JSON | Optional | |
created (anyOf 1) | JSON | Alternative | |
created (anyOf 1) (anyOf 1) | string | Alternative | The datetime the attachment was created. Read only: true |
created (anyOf 1) (anyOf 2) | integer | Alternative | |
created (anyOf 2) | null | Alternative | |
filename | JSON | Optional | |
filename (anyOf 1) | string | Alternative | The name of the attachment file. Read only: true |
filename (anyOf 2) | null | Alternative | |
id | JSON | Optional | |
id (anyOf 1) | JSON | Alternative | |
id (anyOf 1) (anyOf 1) | integer | Alternative | The ID of the attachment. Format: int64 Read only: true |
id (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
id (anyOf 2) | null | Alternative | |
mimeType | JSON | Optional | |
mimeType (anyOf 1) | string | Alternative | The MIME type of the attachment. Read only: true |
mimeType (anyOf 2) | null | Alternative | |
properties | JSON | Optional | |
properties (anyOf 1) | object | Alternative | Additional properties of the attachment. Read only: true Additional keys: see wildcard field |
properties (anyOf 1).* | JSON | Additional keys | Read only: true |
properties (anyOf 2) | null | Alternative | |
self | JSON | Optional | |
self (anyOf 1) | string | Alternative | The URL of the attachment metadata details. Format: uri Read only: true |
self (anyOf 2) | null | Alternative | |
size | JSON | Optional | |
size (anyOf 1) | JSON | Alternative | |
size (anyOf 1) (anyOf 1) | integer | Alternative | The size of the attachment. Format: int64 Read only: true |
size (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
size (anyOf 2) | null | Alternative | |
thumbnail | JSON | Optional | |
thumbnail (anyOf 1) | string | Alternative | The URL of a thumbnail representing the attachment. Read only: true |
thumbnail (anyOf 2) | null | Alternative |
Referenced models: Get user — response body
Get user — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, `displayName` provides an indication and other parameters have default values or are blank (for example, email is blank). * User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted users. In this case, `accountId` returns *unknown* and all other parameters have fallback values. * User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have fallback values. |
accountId | JSON | Optional | |
accountId (anyOf 1) | string | Alternative | The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required in requests. Maximum length: 128 |
accountId (anyOf 2) | null | Alternative | |
accountType | JSON | Optional | |
accountType (anyOf 1) | string | Alternative | The user account type. Can take the following values: * `atlassian` regular Atlassian user account * `app` system account used for Connect applications and OAuth to represent external systems * `customer` Jira Service Desk account representing an external service desk Known values: atlassian, app, customer, unknown Read only: true |
accountType (anyOf 2) | null | Alternative | |
active | JSON | Optional | |
active (anyOf 1) | boolean | Alternative | Whether the user is active. Read only: true |
active (anyOf 2) | null | Alternative | |
appType | JSON | Optional | |
appType (anyOf 1) | string | Alternative | The app type of the user account when accountType is 'app'. Can take the following values: * `service` Service Account * `agent` Rovo Agent Account * `unknown` Unknown app type Read only: true |
appType (anyOf 2) | null | Alternative | |
applicationRoles | JSON | Optional | |
applicationRoles (anyOf 1) | Model | Alternative | Expand Get user — response body — application Roles callback, items, max-results, paging Callback, size The application roles the user is assigned to. Read only: true |
applicationRoles (anyOf 2) | null | Alternative | |
avatarUrls | JSON | Optional | |
avatarUrls (anyOf 1) | Model | Alternative | Expand Get user — response body — avatar Urls 16x16, 24x24, 32x32, 48x48 The avatars of the user. Read only: true |
avatarUrls (anyOf 2) | null | Alternative | |
displayName | JSON | Optional | |
displayName (anyOf 1) | string | Alternative | The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. Read only: true |
displayName (anyOf 2) | null | Alternative | |
emailAddress | JSON | Optional | |
emailAddress (anyOf 1) | string | Alternative | The email address of the user. Depending on the user’s privacy setting, this may be returned as null. Read only: true |
emailAddress (anyOf 2) | null | Alternative | |
expand | JSON | Optional | |
expand (anyOf 1) | string | Alternative | Expand options that include additional user details in the response. Read only: true |
expand (anyOf 2) | null | Alternative | |
groups | JSON | Optional | |
groups (anyOf 1) | Model | Alternative | Expand Get user — response body — groups callback, items, max-results, paging Callback, size The groups that the user belongs to. Read only: true |
groups (anyOf 2) | null | Alternative | |
guest | JSON | Optional | |
guest (anyOf 1) | boolean | Alternative | Whether the user is a guest. Read only: true |
guest (anyOf 2) | null | Alternative | |
key | JSON | Optional | |
key (anyOf 1) | string | Alternative | This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. |
key (anyOf 2) | null | Alternative | |
locale | JSON | Optional | |
locale (anyOf 1) | string | Alternative | The locale of the user. Depending on the user’s privacy setting, this may be returned as null. Read only: true |
locale (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. |
name (anyOf 2) | null | Alternative | |
self | JSON | Optional | |
self (anyOf 1) | string | Alternative | The URL of the user. Format: uri Read only: true |
self (anyOf 2) | null | Alternative | |
timeZone | JSON | Optional | |
timeZone (anyOf 1) | string | Alternative | The time zone specified in the user's profile. If the user's time zone is not visible to the current user (due to user's profile setting), or if a time zone has not been set, the instance's default time zone will be returned. Read only: true |
timeZone (anyOf 2) | null | Alternative |
Referenced models: Get user — response body — avatar Urls 16x16, 24x24, 32x32, 48x48, Get user — response body — application Roles callback, items, max-results, paging Callback, size, Get user — response body — groups callback, items, max-results, paging Callback, size
Get user — response body — avatar Urls 16x16, 24x24, 32x32, 48x48
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
16x16 | JSON | Optional | |
16x16 (anyOf 1) | string | Alternative | The URL of the item's 16x16 pixel avatar. Format: uri |
16x16 (anyOf 2) | null | Alternative | |
24x24 | JSON | Optional | |
24x24 (anyOf 1) | string | Alternative | The URL of the item's 24x24 pixel avatar. Format: uri |
24x24 (anyOf 2) | null | Alternative | |
32x32 | JSON | Optional | |
32x32 (anyOf 1) | string | Alternative | The URL of the item's 32x32 pixel avatar. Format: uri |
32x32 (anyOf 2) | null | Alternative | |
48x48 | JSON | Optional | |
48x48 (anyOf 1) | string | Alternative | The URL of the item's 48x48 pixel avatar. Format: uri |
48x48 (anyOf 2) | null | Alternative |
Get user — response body — groups callback, items, max-results, paging Callback, size callback object
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: atlassian.getattachment. Catalog operation: getattachment. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["read:jira-work"]