How to perform an 'issue action' using AJAX?

Hi,

I am writing a JIRA add-on that adds a button to the workflow buttons area. When the button is clicked I send a request to a REST API using JS.

I want that the issue gets 'greyed out' if I click the button so that the user is not able to take any actions anymore. If you go offline and click for example 'Assign' inside an issue, you will see what behaviour I mean. After the action has finished I want that the issue gets reloaded.

My question is now if there is an API which I can use in order to do this or if I have to implement my own logic.

2 answers

1 accepted

I found out how to dim the screen and show the loading spinner:

AJS.dim();
JIRA.Loading.showLoadingIndicator();

To undim use the following:

AJS.undim();
JIRA.Loading.hideLoadingIndicator(); 

The issue can be updated with the following call:

JIRA.trigger(JIRA.Events.REFRESH_ISSUE_PAGE, [JIRA.Issue.getIssueId()]);

Glad you found the solution :-) Thank you for sharing this.

What do you exactly mean by "gets greyed out"? You could transform the issue to another status for example. That status could prohibit users to take more actions on an issue (e.g. status -> "Done" / "Closed" and remove "re-open" action / hide it from certain users).

I attach a recording of what I mean with "greying out". I don't want to introduce any status transitions.

disabled-issue.gif

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,042 views 13 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot