Hi @IbrahimItani ,
Yes, https://domainexample.atlassian.net/browse/issueKey IssueView is one of the supported entry points.
Do you get any errors or just the logic isn’t being triggered? When running the app in the forge tunnel
, do you see the Serving file index.html for resource uiModificationsMain
log?
I’ve just managed to update the list of labels in that view with the following onInit
code, which contains a lot of `console.log for step-by-step debugging
onInit(
({ api, uiModifications }) => {
console.log('onInit called');
console.log('api:', api);
console.log('uiModifications:', uiModifications);
uiModifications.forEach((uiModification) => {
console.log(`Data for UI modification ID ${uiModification.id}`, uiModification.data);
});
api.getFields().forEach((field) => {
console.log(`Field ${field.getId()} has value ${field.getValue()}`);
});
try {
console.log(`getId: ${api.getFieldById('labels').getId()} `);
console.log(`getName: ${api.getFieldById('labels').getName()} `);
console.log(`getType: ${api.getFieldById('labels').getType()} `);
console.log(`getValue: ${JSON.stringify(api.getFieldById('labels').getValue())} `);
// the field is an array of strings
api.getFieldById('labels').setValue(['label1', 'label2']);
console.log('Set value for labels field');
} catch (error) {
console.error('Error setting value for labels field:', error);
}
},
() => {
console.log('onInit fields callback called');
return ['labels'];
}
);
Here is a screenshot so that you can see the labels being applied:
A few things to keep in mind:
- UI Modifications are only supported on Software projects
- double-check which field is being modified
- double-check the project and IssueType ID used when creating the UiModification
Let us know how it goes,
Caterina