Forums

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

Scriptrunner condition with URL

mfabris
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2022

Hello Community.

 

I have made a web panel that i need to show via fragments only in the "Portals" page in JSM.

Only in this page: https://myjira/servicedesk/customer/portals

 

I found a condition which is almost ok:

 

!binding.variables.get("portal") && !binding.variables.get("request")

Unfortunately, this is not working all the time.

In some cases, my panel appears also in other pages.

 

So I was thinking: what about setting a condition with the URL?

If URL =  myjira/servicedesk/customer/portals then show fragment.

 

Unfortunately I have not found a way to do this so far, despite going through groovy documentation and trying.

 

Anyone did this already and knows how to?

 

 

 

 

 

2 answers

1 accepted

0 votes
Answer accepted
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2022

You should be able to access to URL with

jiraHelper.request.requestURI

Mirco Fabris
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 28, 2022

Thank you Peter! I was also in contact with some other expert from Adaptavist and they suggested a similar solution but still we were not able to implement it.

However we found a cool workaround with a little piece of JavaScript .

I will accept your answer because also according Adaptavist it works, even if I was not able to apply it to my particular situation. Thanks a lot for your time! 

 

Mirco

0 votes
Mehul Patel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 27, 2023

I added a css class to my root html tag , say "test"

I added 2 more fragments "servicedesk.portal.footer.create_request" and "servicedesk.portal.footer.portal." where I set a the css class "test" to "display:none"

That did the trick!

the "binding" solution provide earlier did not work consistently either.


fyi: "jiraHelper" is not recognized in the conditions

Suggest an answer

Log in or Sign up to answer