Open a Modal Dialog when issue is Done

380 Views Asked by At

I’m just starting with Forge and JIRA apps development, I need to open a ModalDialog when an issue changes its state to “Done” (either by dragging it to the Done column or by changing its status in the issue panel). I don’t know where to start, I tried clonning the jira-issue-activity-ui-kit starter but I don’t get where the modal should open, any ideas? Thanks

This is the code I've tried:

const DONE = 'Done';

export async function run(event, context) {
    console.log('Hello World!', event, event.changelog.items);

    // if the issue is solved (status changed to Done)
    if (event.changelog.items.some(function changedToPreferredStatus(change)  {
        return statusChangedTo(change, DONE);
    })) {
        let description = event.issue.fields.summary;

        // OPEN MODAL DIALOG HERE
    }
}

function statusChangedTo(change, to) {
    return change.field === 'status' && change.toString === to;
}
0

There are 0 best solutions below