It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to update issue after getting value from dialog box using script runner

Dear Experts,

 

My scenario is 

  • I have created a button on issue
  • When user click on the button "update issue", system shows a dialog box , to confirm
  • Once your said yes, then update the issue with default parameters(i am not explaining here as there so many

Till here i am done and its working.

 

I am using script runner rest end point and javascript to get the value from  if they said yes.

 I have a groovy method which is updating the field after receiving the key.

I am stuck here how to proceed further, how can i execute the groovy method inside the javascript, once user said proceed.

1 answer

1 accepted

0 votes
Answer accepted

Hi @Muhammad_Ramzan 

 I have a groovy method which is updating the field after receiving the key.

Is this groovy method available as a rest endpoint?

If so, you could make an ajax call from your dialog box javascript to that rest endpoint and provide the issue key as a parameter.

 Here is a recap of scriptunner configuration you will likely need:

  1. GET rest endpoint to serve the html of the dialog2 element
  2. POST rest endpoint to receive issue key and perform actions on the issue
  3. Web Item fragment to display the button that will call GET 
  4. Web Item resource to hold the Javascript used by the dialog2 and trigger an AJAX POST action when the confirm button is clicked (optional, you could also just embed your js in #1)

@Dear @Peter-Dave_Sheehan , many thanks for the solution. I found the solution and did the same as you suggested here. Its working like a champ. many thanks,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

How to run PI Planning in Jira with Remote Teams

  There is nothing better than having everyone in the same room for PI, tribe or big room planning. But it’s not easy, it’s expensive and not everyone can travel.  Kendis offers solution,...

209 views 1 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you