Script fragments : how to run custom groovy code using web-item ?


I want to run some actions while triggering a custom button (web-item most likely), like udpating a custom field value or triggering an event. Is it possible to bind a groovy script to that button ?

I have not seen an example of this, so I guess it is not possible, but I wanted to give it a try.



1 answer

0 vote
Alexey Matveev Community Champion Jan 09, 2018


You need to create a REST end point and then call the rest end from your web item.

Hi Alexey, thanks for your answer.

I have made my script work. Only one thing is missing. I am using a web-item in the operations-top-level section. How to make the section disappear when I click the button ? I want the user to click the button exactly once.



Alexey Matveev Community Champion Jan 10, 2018

Add a web resource with javascript. Attach to the web item click event and hide the web item on click. You can read more here

Thanks, I am almost there.

I successfully hid the button on click. However I would like the drop-down menu (More ...) to close after I click the button, while still having the button available if the user clicks again on More

Is that possible ? I could not find any documentation on that (and I am new to javascript).



Alexey Matveev Community Champion Jan 11, 2018

I have never tried it. 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published yesterday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

415 views 5 5
Read article

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