type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Move version
* Modifies the version's sequence within the project, which affects the display order of the versions in Jira.
This operation can be accessed anonymously.
**[Permissions](#permissions) required:** *Browse projects* project permission for the project that contains the version.
*/
export async function main(
auth: Jira,
id: string,
body: { after?: string; position?: "Earlier" | "Later" | "First" | "Last" }
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/version/${id}/move`
);
const response = await fetch(url, {
method: "POST",
headers: {
"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.json();
}
Submitted by hugo697 396 days ago
type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Move version
* Modifies the version's sequence within the project, which affects the display order of the versions in Jira.
This operation can be accessed anonymously.
**[Permissions](#permissions) required:** *Browse projects* project permission for the project that contains the version.
*/
export async function main(
auth: Jira,
id: string,
body: { after?: string; position?: "Earlier" | "Later" | "First" | "Last" }
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/version/${id}/move`
);
const response = await fetch(url, {
method: "POST",
headers: {
"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.json();
}
Submitted by hugo697 948 days ago