Handling Jira Issue Summary update

In my Jira Cloud app, I need to respond to the event (in the front end) when a user changes the issue summary field, and then use that event to trigger a refresh of my app’s web panel. Can you point me please at how to do both of these please:

  1. Trap the summary field updated event
  2. Refresh the app web-panel

Many thanks in advance.

To trap the summary field change, you can use a Webhook (https://developer.atlassian.com/cloud/jira/platform/modules/webhook/) and handle the jira:issue_updated event and look at the changelog provided in the webhook body.
However, updating your web panel is much more complicated, as there is no mechanism to allow apps to “talk” to the browser. If you were using a “Glance”, you could update the associated issue entity property and it would update the glance. But with a web panel, the only solution I know of is to rely on old style polling from your web panel to either your app’s server or to an issue entity property, but of course it puts additional strain on either your app or the Jira instance.

David

Many thanks David2

I appreciate you taking the time and effort to share. That’s rather disappointing. I was hoping to avoid having to use the Webhooks (going back to my server) to detect a change to the summary field. This requires wasted web traffic as you say. I wanted to trap it in the client then trigger a refresh on the web panel.

Does someone from Atlassian have a trick up their sleeves?

Colin

It feels like it should be possible with a combination of
AP.events.on - to capture the summary field updated event followed by
AP.jira.refreshIssuePage();

Which event would you listen to (remember, this is Jira Cloud)?

I am trying to capture the even that a summary field is updated.

I know, but you suggested using AP.events.on to capture the event, so I’m asking which event you would listen to, as I don’t know of any that would be triggered when a field is modified. I don’t even know where to find the list of events supported by AP.events.on.

It seems that Jira Server has something useful:
https://developer.atlassian.com/server/jira/platform/extending-inline-edit-for-jira-plugins/

Of course our app is cloud only, so what I want is to detect if a user makes an inline edit to the summary field and then trigger a referesh of my plugin web panel. I would have thought that an accessible event is announced when a user does an inline summary field editsave.

Unfortunately, Jira Cloud is a completely different animal, especially on the UI side. For security reasons, app code (html, JS, etc.) is completely isolated from Jira code, using iframes. That’s why you can only listen to events using the AP.events module, and currently Jira Cloud doesn’t broadcast any event through that mechanism (AFAIK), it’s mostly used to support communication between two iframes belonging to the same app.

1 Like

That’s rather tragic. Thank you so much for taking the time to share your wisdom David, much appreciated.

I guess I’ll have to use webhooks and either polling or (i wonder perhaps) websockets to update the webpanel. It would be nice if someone from Atlassian could respond to this thread to confirm what is the best approach, or whether some good news is forthcoming.

Once again, thank you David.

Hi guys, well, I am not sure what exactly are trying to achieve, but I faced to similar issue, and built the workaround.

  1. Remove Summary from edit screen
  2. Create screen just with summary
  3. Create self-transition “edit summary” with just created screen
  4. Catch changes in post-function with some plugin like ScriptRunner or Davids JMWE.
  5. Profit :slight_smile:

Thank you @tvrabec, that is far too much interference with the user’s normal experience to be practical, but it could work for a closed instance.

Well I know it sounds little bit crazy, but it works.

I have a lot request to made a custom field editable based on group / project role / user custom field / insight object membership etc etc. All of those is doable with selftransitions. And it will appear just next to another buttons, so its not so much confusing as it sounds …

Nevertheless, have a nice day and if interested, ping me directly, I can show you some solutions :slight_smile:

In case others are interested. I have allowed users to refresh the iframe with

	AJS.$("#refresh-issue-button").click(function(e) {
		AP.jira.refreshIssuePage();
	});

We could further add polling.