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