type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Bulk update entity properties
* Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for use by Connect apps during app migration.
*/
export async function main(
auth: Jira,
entityType:
| "IssueProperty"
| "CommentProperty"
| "DashboardItemProperty"
| "IssueTypeProperty"
| "ProjectProperty"
| "UserProperty"
| "WorklogProperty"
| "BoardProperty"
| "SprintProperty",
Atlassian_Transfer_Id: string,
body: { entityId: number; key: string; value: string; [k: string]: unknown }[]
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/atlassian-connect/1/migration/properties/${entityType}`
);
const response = await fetch(url, {
method: "PUT",
headers: {
"Atlassian-Transfer-Id": Atlassian_Transfer_Id,
"Content-Type": "application/json",
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 396 days ago
type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Bulk update entity properties
* Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for use by Connect apps during app migration.
*/
export async function main(
auth: Jira,
entityType:
| "IssueProperty"
| "CommentProperty"
| "DashboardItemProperty"
| "IssueTypeProperty"
| "ProjectProperty"
| "UserProperty"
| "WorklogProperty"
| "BoardProperty"
| "SprintProperty",
Atlassian_Transfer_Id: string,
body: { entityId: number; key: string; value: string; [k: string]: unknown }[]
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/atlassian-connect/1/migration/properties/${entityType}`
);
const response = await fetch(url, {
method: "PUT",
headers: {
"Atlassian-Transfer-Id": Atlassian_Transfer_Id,
"Content-Type": "application/json",
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 823 days ago
type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Bulk update entity properties
* Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for use by Connect apps during app migration.
*/
export async function main(
auth: Jira,
entityType:
| "IssueProperty"
| "CommentProperty"
| "DashboardItemProperty"
| "IssueTypeProperty"
| "ProjectProperty"
| "UserProperty"
| "WorklogProperty"
| "BoardProperty"
| "SprintProperty",
Atlassian_Transfer_Id: string,
body: [
{ entityId: number; key: string; value: string; [k: string]: unknown },
...{ entityId: number; key: string; value: string; [k: string]: unknown }[]
]
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/atlassian-connect/1/migration/properties/${entityType}`
);
const response = await fetch(url, {
method: "PUT",
headers: {
"Atlassian-Transfer-Id": Atlassian_Transfer_Id,
"Content-Type": "application/json",
Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 948 days ago