/* * This script provides some example code that can be run on the console in Jira cloud and will get certain bits of text out fo a string'. * All right, title and interest in this code snippet shall remain the exclusive intellectual property of Adaptavist Group Ltd and its affiliates. Customers with a valid ScriptRunner * license shall be granted a non-exclusive, non-transferable, freely revocable right to use this code snippet only within their own instance of Atlassian products. This licensing notice cannot be removed * or amended and must be included in any circumstances where the code snippet is shared by You or a third party." */// --- Remove text in parentheses at the end of a string ---defstring="demo (value in brackets)"defparsedString=string.replaceAll(/\s?\(.*?\)/,"")returnparsedString// --- Get just the issue key out of the url ---defurl="https://demo.atlassian.net/browse/DEMO-1"defpattern=/[^\/]+$/defmatcher=(url=~pattern)if(matcher.find()){defmatch=matcher.group(0)returnmatch}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.