type Jira = {
username: string;
password: string;
domain: string;
};
/**
* Update field configuration items
* Updates fields in a field configuration.
*/
export async function main(
auth: Jira,
id: string,
body: {
fieldConfigurationItems: {
description?: string;
id: string;
isHidden?: boolean;
isRequired?: boolean;
renderer?: string;
}[];
}
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/fieldconfiguration/${id}/fields`
);
const response = await fetch(url, {
method: "PUT",
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;
};
/**
* Update field configuration items
* Updates fields in a field configuration.
*/
export async function main(
auth: Jira,
id: string,
body: {
fieldConfigurationItems: {
description?: string;
id: string;
isHidden?: boolean;
isRequired?: boolean;
renderer?: string;
}[];
}
) {
const url = new URL(
`https://${auth.domain}.atlassian.net/rest/api/2/fieldconfiguration/${id}/fields`
);
const response = await fetch(url, {
method: "PUT",
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