Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @NOTE: Замена доменов в jira с oldDomain на newDomain
- // reference: https://confluence.atlassian.com/jirakb/how-to-update-or-change-outgoing-links-from-jira-issues-and-dashboards-1005786896.html
- const oldDomain = 'moskit.pro'
- const newDomain = 'web-bee.ru'
- const subDomains = [
- 'jira',
- 'confluence',
- 'bitbucket',
- 'jenkins',
- 'testit',
- 'vault',
- 'firezone',
- 'sut',
- 'nexus',
- 'keycloak',
- 'vorota',
- 'casl',
- 'gitlab',
- 'drive',
- ]
- const template = `
- update gadgetuserpreference set userprefvalue = REPLACE(userprefvalue, 'old-url.com', 'new-url.com') where userprefvalue like '%old-url.com%';
- update remotelink set url = replace(url,'old-url.com','new-url.com') where url like '%old-url.com%';
- update remotelink set iconurl = replace(iconurl,'old-url.com','new-url.com') where iconurl like '%old-url.com%';
- update jiraissue set description = REPLACE(description, 'old-url.com', 'new-url.com') where description like '%old-url.com%';
- update jiraaction set actionbody = REPLACE(actionbody, 'old-url.com', 'new-url.com') where actiontype = 'comment' and actionbody like '%old-url.com%';
- update customfieldvalue set stringvalue = REPLACE(stringvalue, 'old-url.com', 'new-url.com') where stringvalue like '%old-url.com%';
- update customfieldvalue set textvalue = REPLACE(textvalue, 'old-url.com', 'new-url.com') where textvalue like '%old-url.com%';
- update "AO_550953_SHORTCUT" set "SHORTCUT_URL" = REPLACE("SHORTCUT_URL", 'old-url.com', 'new-url.com') where "SHORTCUT_URL" like '%old-url.com%';
- `
- const result = subDomains
- .map((subDomain) => {
- const result = template.replaceAll('old-url.com', `${subDomain}.${oldDomain}`).replaceAll('new-url.com', `${subDomain}.${newDomain}`)
- return `-- ${subDomain}.${oldDomain} -> ${subDomain}.${newDomain}\n${result}`
- })
- .join('\n')
- console.log('RUN IN SQL JIRA SERVER')
- console.log(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement