Script Fragments - How to add JS to a Web item

Hello Community,

I would like to know if there is a way to have HTML code in a Web Item and have JS code that modifies the HTML code.

I want to implement a sort of search box.

I envision utilizing a simple text area where people will input words and a button "search".

Button search will be hooked up to a Rest EndPoint.

I want it so when I click search JS grabs whatever is in the text area and appends it to the end of the Rest EndPoint URL.

So that I can grab the everything at the end of the Rest Endpoint URL via the "additionalPath" method.

Is this possible?



1 answer

1 accepted

Accepted Answer
2 votes
Alexey Matveev Community Champion Jan 05, 2018

I think it is possible. But your solution would be too difficult to support. I do not think you should use ScriptRunner for the task. But if you still want to do it , then you could do it the following way:

1. Create web-item in Scriptrunner and choose "Do nothing you will use javascript to bind an action"

2. Create your REST endpoint

3. Install web resource. You should add your custom javascript in which you would connect to the web item created in 1 and add needed by you search box and call your REST endpoint.


I guess that would do the trick. But I never tried it and I do not have plans to try it.

@Alexey Matveev,

You where right, its hard to support.

I ended up using a static URL in an HTML document that re-directed over to site.



Rajesh G I'm New Here Aug 07, 2018

I am looking for exactly the same solution , can you let me know how you have implemented search

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

23,493 views 2 7
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