Forums

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

Scriptrunner Condtion to check user URL is homepage

AisM
Contributor
September 20, 2023

I have a Scriptrunner fragment, which is supposed to run when certain conditions are met. One of the condition is to check if user URL is the homepage . I have the below code, but for some reason it doesn't work. But it does work for the date logic alone, and not when combined with the user URL . Can anyone please validate if its right.

 

def webActionSupport = ComponentAccessor.getComponent(JiraWebActionSupport)
def requestURL = webActionSupport.getHttpRequest().getRequestURI()

def homepageURL = "my homepageURL"

//Logic defined at end of script

if ((requestURL == homepageURL) && (today>=start && today<=end)) {
log1.info("Success:")
return true
}
}
return false

 

1 answer

0 votes
AisM
Contributor
September 20, 2023 edited

@Antoine Berry  The requirement was like, we need to have a dialog pop up box at the time of maintenance. When the user logs in, the box must pop up. Also, the time when this must show up must be controlled from a service desk. 

We were able to actually achieve this. The dates for when the box shows up is done through two custom field vales "Start date & end date". 

But the problem I have is, the box shows up every time the page loads. More like a nuisance at this point. I want the pop up box to be limited to once per user in a day, or maybe ONLY at the log in page or something. 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events