Hello, We have a free text field on which we are planning to add the URLs as there is a Character Limitation for Jira URL fields.
Can we add some workflow validations, conditions which will check for a proper URL which starts with 'https://' and contains 'Sharepoint' in it.
We have JMWE and Scriptrunner plugins added to our site.
Thanks in Advance
Madhu
Hi @Madhu Reddy
using a Scripted (Groovy) Validator (JMWE app), you can use a very similar script:
issue.get("text field") ==~ /^https\:\/\/\w+(-my|-admin){0,1}\.sharepoint\.com((\/\w+[_\-\.']{0,}\w+){0,}[^\.](\w+[-_'\d]{0,})){0,}$/
Hi @David Fischer First of All, Thanks for the response.
Tried the script suggested above, getting the validation error that please enter the valid url.
Attached the screenshots for your reference.
Please have a look and correct me if I was wrong, Thanks.
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I actually reused Vikrant's regex, it doesn't really match your URLs.
Try this:
issue.get("text field") ==~ /^https\:\/\/\w+(-my|-admin){0,1}\.sharepoint\.com\/.*$/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This code worked for me @David Fischer Thanks a lot for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Madhu Reddy Try below Code, it should work :-
Apply ScriptRunner :- Simple Scripted Validator
cfValues['URL Field Name'] ==~ /^((?:https?:\/\/)?(?:www\.)?[-\w@:%.+~#=]{2,256}\.[a-z]{2,6}\b[-\w@:%+.~#?&\/=]*|)$/
Let me know the result
Thanks
Vikrant Yadav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For sharepoint site Regex would be something like this :-
cfValues['URL Field Name'] ==~ /^https\:\/\/\w+(-my|-admin){0,1}\.sharepoint\.com((\/\w+[_\-\.']{0,}\w+){0,}[^\.](\w+[-_'\d]{0,})){0,}$/
Thanks
V.Y
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Vikrant Yadav This worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.