Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Web item redirecting

Pradeep A
Contributor
July 14, 2021

Hi I have created a web Item. When I click the web Item it should run a script. The script works fine but the page is redirected to the rest end point URL. Any solutions please?

2 answers

0 votes
Nhac Tat Nguyen
Contributor
July 14, 2021

If you can apply Javascript for the web-item. Simply add a onClick event, then preventDefault() on that item.

Edit: You can also set the href for your item to #.

Pradeep A
Contributor
July 14, 2021

I'm unable to add JS to the web Item. And I need to provide the rest end point URL to run the code. So I can't give #

Like Nhac Tat Nguyen likes this
Nhac Tat Nguyen
Contributor
July 15, 2021

@Pradeep A how did you create your web-item (by a plugin, scriptrunner,...)?

Pradeep A
Contributor
July 15, 2021

@Nhac Tat Nguyen Script runner

Nhac Tat Nguyen
Contributor
July 15, 2021

@Pradeep A with ScriptRunner, you can set your web-item to "Run code and show a flag" and still keep your URL.Screenshot 2021-07-15 143139.png

Like Pradeep A likes this
Pradeep A
Contributor
July 15, 2021

Thanks @Nhac Tat Nguyen  Also can you please tell me how to send nested Json input to an HTTP request currently i'm doing like this

jsonBody.put("template@odata.bind","https://graph.microsoft.com/v1.0/teamsTemplates('standard')")

jsonBody.put("displayName", displayName)

jsonBody.put("description", description)

0 votes
Pradeep A
Contributor
July 14, 2021

@srinivasp you said you had similar issues right? Any solutions?. If you di have please mention the solution.

Suggest an answer

Log in or Sign up to answer