Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Do Not Lose your Customer’s Trust

Missing deadlines is one of the biggest problems every team lead wants to avoid when dealing with managed services. When the customer contracts your company to help with IT services it is expected th...

327 views 0 2
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