0

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;
}
Joaquín L. Robles
  • 6,261
  • 10
  • 66
  • 96
  • 1
    I guess there is no way to open a modal in Jira from a Forge web hook. You could use a custom glance which polls a Jira entity property (https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/), which you can set in the webhook. But polling is always not nice. Another possibility would be to use the inbuilt Jira automation (in Project settings) to define a rule that is triggered "When Issue transitioned to DONE" and then unfortunately can't open a modal or a notification, but send an email or a Slack message. – Michael Sep 01 '21 at 18:11
  • Ok @Michael I understand, where are now looking into a workaround with issue comments or smth like that, thanks! – Joaquín L. Robles Sep 01 '21 at 18:35

0 Answers0