diff --git a/Lib/Atlasy.ahk b/Lib/Atlasy.ahk index fdf39fd..fa3d19a 100644 --- a/Lib/Atlasy.ahk +++ b/Lib/Atlasy.ahk @@ -2,14 +2,7 @@ #Include ; Launcher for Atlassian related Tools: Jira, Confluence, Bitbucket, BigPicture, R4J, Xray -; Example of commands -; j : jira -; jc: jira cloud -; c : confluence -; cc : confluence cloud -; bp : BigPicture -; r : r4j -; d|g doc or guidelines (PMT space) +; See documentation of commands in Atlasy.md ; s : search ; r : recent @@ -43,27 +36,19 @@ Atlasy(sInput:="-g"){ Case "h","-h","help": Atlasy_Help(sInput) return - Case "jl": ; quick add link - ;IssueKeys := Jira_GetIssueKeys() - sLog := Jira_AddLink("",Jira_GetIssueKeys()) ; user will be prompted for link name and target issues - If !(sLog = "") { - ;TrayTipAutoHide("e.CoSys PowerTool",Text) - ;TrayTip, e.CoSys PowerTool, %Text% - OSDTIP_Pop("PowerTool: Link(s) added!",sLog) - } - return - Case "j": + Case "?": + sFile:= A_ScriptDir . "\doc\Atlasy.md" + Run, %sFile% + Case "j": ;#jira If (sInput = "") { - - - Atlasy_OpenIssue() + Jira_OpenIssues() return } JiraRootUrl := Jira_GetRootUrl() IsCloud := Jira_IsCloud(JiraRootUrl) ; Short navigation keys - If (sInput = "-b") or RegExMatch(sInput,"^\-b\s(.*)",sMatch) { + If (sInput = "-b") or (sInput = "b") or RegExMatch(sInput,"^\-?b\s(.*)",sMatch) { If IsCloud sUrl := JiraRootUrl . "/jira/boards?contains=" . sMatch1 Else @@ -72,18 +57,12 @@ Atlasy(sInput:="-g"){ return } - If (sInput = "-s") { - sUrl := JiraRootUrl . "/issues/?jql=" . sMatch1 - Atlasy_OpenUrl(sUrl) - Return - } - If RegExMatch(sInput,"^\-?s\s(.*)",sMatch) { Jira_QuickSearch(sMatch1) Return } - If (sInput = "-l") { ; AddLink + If (sInput = "-l") or (sInput = "l") { ; AddLink ;IssueKeys := Jira_GetIssueKeys() sLog := Jira_AddLink("",Jira_GetIssueKeys()) ; user will be prompted for link name and target issues If !(sLog = "") { @@ -98,9 +77,19 @@ Atlasy(sInput:="-g"){ Jira_CreateIssue("",sMatch1) return } + + If (sInput = "b") { ; bulk edit + Jira_BulkEdit() + return + } + + If (sInput = "n") { ; open issues in issue navigator + Jira_OpenIssuesNav() + return + } ; issue Key - sKeyPat := "i)([A-Z\d]{3,}\-[\d]{1,})" + sKeyPat := "i)^([A-Z\d]{3,}\-[\d]{1,})$" If RegExMatch(sInput,sKeyPat,sMatch) { sUrl := JiraRootUrl . "/browse/" . sMatch1 Atlasy_OpenUrl(sUrl) @@ -108,22 +97,22 @@ Atlasy(sInput:="-g"){ } ; Project Key - sKeyPat := "i)([A-Z\d]{3,})" + sKeyPat := "i)^([A-Z\d]{3,})$" If RegExMatch(sInput,sKeyPat,sMatch) { sUrl := JiraRootUrl . "/browse/" . sMatch1 Atlasy_OpenUrl(sUrl) Return } - If (sInput = "-i") or RegExMatch(sInput,"^\-i\s(.*)",sMatch) { + If (sInput = "-i") or (sInput = "i") or RegExMatch(sInput,"^\-?i\s(.*)",sMatch) { sUrl := JiraRootUrl . "/issues/?jql=" . sMatch1 Atlasy_OpenUrl(sUrl) Return } - If (sInput = "-f") or RegExMatch(sInput,"^\-f\s(.*)",sMatch) { + If (sInput = "-f") or (sInput = "f") or RegExMatch(sInput,"^\-?f\s(.*)",sMatch) { If IsCloud - sUrl := JiraRootUrl . "/jira/filters?name=" . sMatch1 + sUrl := JiraRootUrl . "/jira/filters?name=""" . sMatch1 . """" Else sUrl := JiraRootUrl . "/secure/ManageFilters.jspa" Atlasy_OpenUrl(sUrl) @@ -132,18 +121,18 @@ Atlasy(sInput:="-g"){ ; dp; default project - If (sInput = "-dp") { + If (sInput = "-dp") or (sInput = "dp") { PowerTools_SetSetting("JiraProject") return } - If RegExMatch(sInput,"^\-dp\s(.*)",sMatch) { + If RegExMatch(sInput,"^\-?dp\s(.*)",sMatch) { StringUpper, pj, sMatch1 PowerTools_RegWrite("JiraProject",pj) return } - If (sInput = "-pl") { ; Project List + If (sInput = "-pl") or (sInput = "pl") { ; Project List SettingName := "JiraProjects" Section := "Jira" Projects := PowerTools_IniRead(Section,SettingName) @@ -157,14 +146,14 @@ Atlasy(sInput:="-g"){ return } - Case "e": - If (sInput = "-p") { + Case "e": ;#eCoSys + If (sInput = "-p") or (sInput = "p") { PowerTools_SetSetting("ECProject") return - } Else If RegExMatch(sInput,"^\-p\s(.*)",sMatch) { + } Else If RegExMatch(sInput,"^\-?p\s(.*)",sMatch) { StringUpper, pj, sMatch1 PowerTools_RegWrite("ECProject",pj) - } Else If (sInput = "-pl") { ; Project List + } Else If (sInput = "-pl") or (sInput = "pl") { ; Project List SettingName := "ECProjects" Section := "e.CoSys" Projects := PowerTools_IniRead(Section,SettingName) @@ -179,7 +168,7 @@ Atlasy(sInput:="-g"){ return ;---------------------- - Case "r","r4j": + Case "r","r4j": ;#r4j If (sInput = "") { sIssueKey := R4J_GetIssueKey() If !(sIssueKey = "") { @@ -212,15 +201,18 @@ Atlasy(sInput:="-g"){ If (cmd != "") { Switch cmd { - Case "-cp": ; Copy Path Jql + Case "-cp","cp": ; Copy Path Jql R4J_CopyPathJql() return - Case "-p": ; Paste Migrated Jql + Case "-cc","cc": ; Copy Children Jql + R4J_CopyChildrenJql() + return + Case "-p","p": ; Paste Migrated Jql Jql := Clipboard NewJql := R4J_Migrate_Jql(Jql) Clip_Paste(NewJql) return - Case "-f": ; Open in issue navigator r4jPath filter + Case "-n","n": ; Open in issue navigator r4jPath filter R4J_OpenPathJql() return Case "-cv","-c","-t","-tv": @@ -259,7 +251,7 @@ Atlasy(sInput:="-g"){ R4J_OpenProject(pj,view) ;---------------------- - Case "x": ; xray, test + Case "x": ; #xray view := "r" ; default repository Loop, Parse, % Trim(sInput), %A_Space% { @@ -281,14 +273,18 @@ Atlasy(sInput:="-g"){ Xray_Open(view,pj) return - Case "c": ; Confluence + Case "c": ; #Confluence If (sInput = "") { Atlasy_OpenUrl(Confluence_GetRootUrl()) return } - + If InStr(sInput,"order") { + Confluence_Reorder() + return + } + If RegExMatch(sInput,"^\-?s?\s(.*)",sMatch) { Confluence_QuickSearch(sMatch1) Return @@ -299,8 +295,6 @@ Atlasy(sInput:="-g"){ Return } - - FoundPos := InStr(sInput," ") If FoundPos { sSpace := SubStr(sInput,1,FoundPos-1) @@ -308,7 +302,7 @@ Atlasy(sInput:="-g"){ } Else sSpace := sInput Confluence_SearchSpace(sSpace,sQuery) - Case "bp": ; BigPicture + Case "bp": ; #BigPicture JiraRootUrl := Jira_GetRootUrl() If InStr(JiraRootUrl,".atlassian,net") { ; cloud sUrl := JiraRootUrl . "/plugins/servlet/ac/eu.softwareplant.bigpicture/bigpicture" ;#!box/ROOT/o/hierarchy" @@ -318,6 +312,21 @@ Atlasy(sInput:="-g"){ Atlasy_OpenUrl(sUrl) return + Case "bb": ; #BitBucket + Url := PowerTools_IniRead("BitBucket","BitBucketRootUrl") + If (BUrl="ERROR") { + MsgBox 0x1010, Error, BitBucketRootUrl key not defined in BitBucket section in PowerTools.ini file! + return + } + If (sInput = "") + defProject := PowerTools_GetSetting("ECProject") + Else + defProject := sInput + If !(defProject ="") + Url := Url . "/projects/" . defProject + Atlasy_OpenUrl(Url) + return + Case "sw": ; switch server <->cloud If !Browser_IsWinActive() { TrayTipAutoHide("e.CoSys PowerTool","Switch only possible from browser window!") @@ -433,6 +442,7 @@ return false ; ----------------------------------------- Atlasy_OpenUrl(sUrl) { + ;MsgBox % sUrl ; DBG If (sUrl="") return ; Get Browser from PowerTools.ini Settings [Atlasy] section with optional keys Browser and BrowserCloud @@ -472,8 +482,11 @@ Atlasy_Help(sKeyword:=""){ sUrl := "" Case "f","fav","f+","of": ; favorites sUrl := "" + Case "cmd": + } ; end switch - Run, "%sUrl%" + + Run, %sUrl% } ; eofun ; ------------------------------------------------------------------------------------------------------------------- @@ -533,7 +546,8 @@ Atlasy_HotkeyActivate(HKid,HK,showTrayTip := False) { Hotkey, IfWinActive, ; for all windows/ global hotkey Hotkey, $%HK%, Atlasy_%HKid%, On ; use $ to avoid self-referring hotkey if Ctrl+Shift+M is used If (showTrayTip) { - TipText = Atlasy %HKid% Hotkey set to %HK% + HKrev := Hotkey_ParseRev(HK) + TipText = Atlasy %HKid% Hotkey set to %HKrev% TrayTipAutoHide("Atlasy " . HKid . " Hotkey On",TipText,2000) } } ; eofun @@ -541,42 +555,116 @@ Atlasy_HotkeyActivate(HKid,HK,showTrayTip := False) { ; ------------------------------------------------------------------------------------------------------------------- Atlasy_OpenIssueDoc() { ; ^+v:: ; <--- Open Issue in R4J Document - If GetKeyState("Ctrl") and !GetKeyState("Shift") { - PowerTools_OpenDoc("atlasy_openissuedoc") +If GetKeyState("Ctrl") and !GetKeyState("Shift") { + PowerTools_OpenDoc("atlasy_openissuedoc") + return +} +If WinActive("ahk_exe EXCEL.EXE") { + sKey := Jira_Excel_GetIssueKeys() + If (sKey="") return - } - If WinActive("ahk_exe EXCEL.EXE") { - sKey := Jira_Excel_GetIssueKeys() - If (sKey="") - return - R4J_OpenIssues(sKey) - } Else { - R4J_OpenIssueSelection() - } + R4J_OpenIssues(sKey) +} Else { + R4J_OpenIssueSelection() +} } ; eofun ; ------------------------------------------------------------------------------------------------------------------- + Atlasy_OpenIssue() { If GetKeyState("Ctrl") and !GetKeyState("Shift") { - PowerTools_OpenDoc("atlasy_openissue") - return + PowerTools_OpenDoc("jira_openissue") + return } +Jira_OpenIssues() +} ; eofun -If R4J_IsWinActive() { - R4J_OpenIssueSelection() + +; ------------------------------------------------------------------------------------------------------------------- +Atlasy_DatePicker() { + static date + DatePicker(date) + If !date ; empty= cancel + return + If Browser_IsWinActive() { + Url := Browser_GetUrl() + If Confluence_IsUrl(Url) { + FormatTime, date, %date%, M/dd/yyyy + SendInput / + Sleep 200 + SendInput / + Sleep 200 + SendInput {Enter} + Sleep 200 + SendInput %date% + SendInput {Esc} + return + } Else If Jira_IsUrl(Url) { + FormatTime, date, %date%, M/dd/yyyy + Clipboard := date + TrayTipAutoHide("Atlasy","Date copied to clipboard!") + return + } + } ; eif browser + + DateFormat := PowerTools_IniRead("General","DateFormat") + If (DateFormat="ERROR") + DateFormat := "" + FormatTime, date, %date%, %DateFormat% + SendInput %date% + +} ; eofun +; ------------------------------------- +DatePicker(ByRef DatePicker){ + ;static DatePicker + Gui, +LastFound + gui_hwnd := WinExist() + Gui, Add, MonthCal, 4 vDatePicker + Gui, Add, Button, Default , &OK + Gui Add, Button, x+0, Cancel + Gui, Show , , Date Picker + WinWaitClose, AHK_ID %gui_hwnd% return -} -If WinActive("ahk_exe EXCEL.EXE") { - sKey := Jira_Excel_GetIssueKeys() - If (sKey="") - return - Jira_OpenIssues(sKey) -} Else { - ik := Jira_OpenIssueSelection() - If (ik="") { - JiraRootUrl := Jira_GetRootUrl() - Atlasy_OpenUrl(JiraRootUrl) - } -} -} ; eofun \ No newline at end of file + + ButtonOK: + Gui, submit ;, nohide + Gui, Destroy + ;Gui, Hide + return + + GuiEscape: + ButtonCancel: + GuiClose: + Gui, Destroy + return +} ; eofun +; ------------------------------------------------------------------------------------------------------------------- +Atlasy_CurrentDate() { +If Browser_IsWinActive() { + Url := Browser_GetUrl() + If Confluence_IsUrl(Url) { + SendInput / + Sleep 200 + SendInput / + Sleep 200 + SendInput {Enter} + Sleep 200 + SendInput {Esc} + return + } Else If Jira_IsUrl(Url) { + FormatTime, date, , M/dd/yyyy + SendInput %date% + return + } +} ; eif browser + +DateFormat := PowerTools_IniRead("General","DateFormat") +If (DateFormat="ERROR") + DateFormat := "" +FormatTime, date, %date%, %DateFormat% +SendInput %date% + +} ; eofun +; ------------------------------------------------------------------------------------------------------------------- + \ No newline at end of file diff --git a/Lib/BigPicture.ahk b/Lib/BigPicture.ahk new file mode 100644 index 0000000..b4b739d --- /dev/null +++ b/Lib/BigPicture.ahk @@ -0,0 +1,58 @@ +BigPicture_IsUrl(sUrl) { + return InStr(sUrl,"bigpicture") +} ; eofun + +BigPicture_Redirect(sUrl,tgtRootUrl:="") { +If (tgtRootUrl = "") { ; read from Ini file Cloud JiraRootUrls + If !FileExist("PowerTools.ini") { + PowerTools_ErrDlg("No PowerTools.ini file found and not tgtRootUrl passed!") + return + } + + IniRead, JiraRootUrls, PowerTools.ini,Jira,JiraRootUrls + If (JiraRootUrls="ERROR") { ; Section [Jira] Key JiraRootUrls not found + PowerTools_ErrDlg("JiraRootUrls key not found in PowerTools.ini file [Jira] section!") + return + } + + If InStr(sUrl,".atlassian.net") { ; from Cloud to Server + Loop, Parse, JiraRootUrls,`, + { + If !InStr(A_LoopField,".atlassian.net") + tgtRootUrl := A_LoopField + } + If (tgtRootUrl ="") { + PowerTools_ErrDlg("JiraRootUrls does not contain a Server url!") + return + } + + + } Else { ; from server to Cloud + Loop, Parse, JiraRootUrls,`, + { + If InStr(A_LoopField,".atlassian.net") + tgtRootUrl := A_LoopField + } + If (tgtRootUrl ="") { + PowerTools_ErrDlg("JiraRootUrls does not contain a Cloud url!") + return + } + } +} +tgtRootUrl := RegExReplace(tgtRootUrl,"/$") ; remove trailing sep +RegExMatch(sUrl,"https?://[^/]*",srcRootUrl) +tgtUrl := StrReplace(sUrl,srcRootUrl,tgtRootUrl) + + +; box +; $rootsv/plugins/servlet/softwareplant-bigpicture/#/box/PROG-58/g +; $rootc/plugins/servlet/ac/eu.softwareplant.bigpicture/bigpicture#!box/PROG-58/g + +If (!InStr(tgtUrl,".atlassian.net") & InStr(sUrl,".atlassian.net")) { ; cloud to server + tgtUrl := StrReplace(tgtUrl,"/ac/eu.softwareplant.bigpicture/bigpicture#!","/softwareplant-bigpicture/#/") +} Else If (InStr(tgtUrl,".atlassian.net") & !InStr(sUrl,".atlassian.net")) { ; server to cloud + tgtUrl := StrReplace(tgtUrl,"/softwareplant-bigpicture/#/","/ac/eu.softwareplant.bigpicture/bigpicture#!") +} +return tgtUrl + +} ; eofun \ No newline at end of file diff --git a/Lib/BitBucket.ahk b/Lib/BitBucket.ahk new file mode 100644 index 0000000..5d76636 --- /dev/null +++ b/Lib/BitBucket.ahk @@ -0,0 +1,17 @@ + +BitBucket_CleanLink(sUrl){ +; link := BitBucket_CleanLink(sUrl) +; link[1]: Link url +; link[2]: Link display text +; Paste link with Clip_PasteLink(link[1],link[2]) +; Called by: IntelliPaste + +If !RegExMatch(sUrl, "/projects/([^/]*)/repos/([^/]*)/browse/") + return +linkText := RegExReplace(sUrl,"https?://[^/]*/projects/") ; remove root url +linkText := StrReplace(linkText, "/repos/" ,">") +linkText := StrReplace(linkText, "/browse/" ,">") +linkText := "BitBucket:" . linkText + +return [sUrl, linkText] +} diff --git a/Lib/Jira.ahk b/Lib/Jira.ahk index be87628..a8c3759 100644 --- a/Lib/Jira.ahk +++ b/Lib/Jira.ahk @@ -279,17 +279,12 @@ needle := "\s\-u" If RegExMatch(sJql,needle) sJql := RegExReplace(sJql, needle, " AND resolution = Unresolved") - -; Default Filter from ini file -JiraDefJql := PowerTools_IniRead("Jira","JiraDefJql") -If !(JiraDefJql="ERROR") { - sJql := JiraDefJql . " AND " . RegExReplace(sJql,"^\s?AND ") -} - ; Default Project -If RegExMatch(searchString,"^\-p\s([^\s]*)",sMatch) +needle := "\s\-?p\s([^\s]*)" +If RegExMatch(sJql,needle,sMatch) { projectKey := sMatch1 -Else { + sJql := RegExReplace(sJql, needle) +} Else { defProjectKey := PowerTools_GetSetting("JiraProject") If !(defProjectKey="") projectKey := defProjectKey @@ -297,13 +292,27 @@ Else { If !(projectKey = "") sDefJql = project = %projectKey% +sJql := RegExReplace(sJql,"^\s?AND ") If !(sDefJql = "") { - sJql := sDefJql . " AND " . RegExReplace(sJql,"^\s?AND ") + If (sJql ="") + sJql := sDefJql + Else + sJql := sDefJql . " AND " . RegExReplace(sJql,"^\s?AND ") +} + +; Default Filter from ini file +JiraDefJql := PowerTools_IniRead("Jira","JiraDefJql") +If !(JiraDefJql="ERROR") { + If (sJql = "") + sJql := JiraDefJql + Else + sJql := JiraDefJql . " AND " . RegExReplace(sJql,"^\s?AND ") } -sJql := RegExReplace(sJql,"^\s?AND ") -searchUrl := jiraRootUrl . "/issues/?jql=" . sJql . sJqlLabels -Atlasy_OpenUrl(searchUrl) +sJql := RegExReplace(sJql,"^\s?AND ") +If (sJql ="") + sJqlLabels := RegExReplace(sJqlLabels,"^\s?AND ") +Jira_OpenJql(sJql . sJqlLabels,jiraRootUrl) } ; eofun ; ---------------------------------------------------------------------- @@ -451,7 +460,7 @@ Else If RegExMatch(sUrl,"/browse/(?P[A-Z\d]*)-(?P\d*)$",Out MsgBox, 0x24,IntelliPaste: Question, Do you want to convert Ticket link into an Issue link? IfMsgBox Yes { - RegExMatch(sUrl, "https://[^/]*", sRootUrl) ; Get RootUrl + RegExMatch(sUrl,"https://[^/]*", sRootUrl) ; Get RootUrl sUrl = %sRootUrl%/browse/%sIssueKey% } sLinkText := sIssueKey @@ -793,7 +802,7 @@ For i, issue in JsonIssues } ; eofun ; ------------------------------------------------------------------------------------------------------------------- -Jira_GetIssueKeys(sIssueKeys :=""){ +Jira_GetIssueKeys(sIssueKeys :=""){ ; @fun_Jira_GetIssueKeys@ ; KeyArray := Jira_GetIssueKeys() ; returns a String Array which each element containing an IssueKey (string) @@ -816,11 +825,8 @@ If Browser_WinActive() { } ; end if R4J_IsUrl If Jira_IsUrl(sUrl) { - KeyArray := Jira_Url2IssueKeys(sUrl) return KeyArray - - } ; end if Jira_IsUrl } Else If WinActive("ahk_exe EXCEL.EXE") { @@ -833,6 +839,7 @@ return Jira_Selection2IssueKeys(sSelection) } ; eofun +; ------------------------------------------------------------------------------------------------------------------- Jira_Url2IssueKeys(sUrl) { @@ -845,9 +852,7 @@ Jira_Url2IssueKeys(sUrl) { If RegExMatch(sUrl,"iU)/issues/\?jql=(?:issue)?Key\sin\s\((.*)\)",sMatch) { Loop sMatch1, `, - { KeyArray.Push(A_LoopField) - } return KeyArray } ; From Bulk Edit e.g. R4J @@ -860,17 +865,16 @@ Jira_Url2IssueKeys(sUrl) { } return KeyArray } - - ; cloud TODO + ; cloud ; $root/secure/views/bulkedit/BulkEdit1!default.jspa?reset=true&jql=key%20in%20(RDMO-24%2CRDMO-23%2CRDMO-25) If RegExMatch(sUrl,"iU)/bulkedit/.*jql=key\sin\s\((.*)\)",sMatch) { Loop,Parse, sMatch1,`, { + ;MsgBox % A_LoopField ; DBG KeyArray.Push(Trim(A_LoopField)) } return KeyArray } - Key := Jira_Url2IssueKey(sUrl) If (Key = "") return @@ -883,7 +887,6 @@ Jira_Selection2IssueKeys(sSelection :="") { ; return a String Array of Keys If (sSelection="") sSelection := Clip_GetSelection() - If (sSelection = "") return [] @@ -914,24 +917,19 @@ ClipSaved := ClipboardAll ; Try first if selection is manually set (Triple click doesn't work in Outlook #35) sSelection := Clip_GetSel() - If (sSelection = "") { Click 3 ; Click 2 won't get the word because "-" split it. Select the line ; Does not work in Outlook Send, ^c ;Copy (Ctrl+C) Click ; Remove word selection - } - sSelection := Clipboard Clipboard := ClipSaved ; restore clipboard - If (sSelection = "") return ; Loop on issue keys - sPat := "([A-Z\d]{3,})-([\d]{1,})" Pos = 1 While Pos := RegExMatch(sSelection,sPat,sMatch,Pos+StrLen(sMatch)) @@ -946,17 +944,71 @@ return SubStr(sIssueKeyList,1,-1) ; remove ending ; } ; eofun ; --------------------------------------------------------------------------------- - -Jira_OpenIssues(IssueArray) { +Jira_OpenIssues(IssueArray:="") { +; Open Issues one-by-one in issue details view +If (IssueArray ="") + IssueArray := Jira_GetIssueKeys() If IsObject(IssueArray) { for index, element in IssueArray - { - Jira_OpenIssue(element) - } -} Else { + { + Jira_OpenIssue(element) + } +} Else Jira_OpenIssue(IssueArray) +} ; eofun +; --------------------------------------------------------------------------------- + +Jira_OpenIssuesNav(IssueArray:="") { +; Open Issues in issue navigator +If GetKeyState("Ctrl") and !GetKeyState("Shift") { + PowerTools_OpenDoc("jira_openissue") + return } +If (IssueArray ="") + IssueArray := Jira_GetIssueKeys() +If IsObject(IssueArray) { + for index, key in IssueArray + { + If (index=1) + jql := "key in (" . key + Else + jql := jql . "," . key + } + jql := jql . ")" +} Else + jql := "key in (" . key . ")" +Jira_OpenJql(Jql) +} ; eofun +; --------------------------------------------------------------------------------- + +Jira_OpenJql(Jql,rootUrl:="") { +If (rootUrl = "") + rootUrl := Jira_GetRootUrl() +Url := rootUrl . "/issues/?jql=" . Jql +Atlasy_OpenUrl(Url) +} ; eofun +; --------------------------------------------------------------------------------- + +Jira_BulkEdit(IssueArray:="") { +; Open Issues in Bulk Edit +; $root/secure/views/bulkedit/BulkEdit1!default.jspa?issueKeys=RDMO-16%2CRDMO-18&reset=true +If (IssueArray ="") + IssueArray := Jira_GetIssueKeys() + +If IsObject(IssueArray) { + for index, key in IssueArray + { + If (index=1) + ikl := key + Else + ikl := ikl . "%2C" . key + } +} Else + ikl := key + +Url := Jira_GetRootUrl() . "/secure/views/bulkedit/BulkEdit1!default.jspa?issueKeys=" . ikl +Atlasy_OpenUrl(Url) } ; eofun ; ------------------------------------------------------------------------------------------------------------------- @@ -1180,12 +1232,7 @@ Loop, Parse, sLinkName,`, linkNames := RegExReplace(linkNames, "^,","") ; remove first , sJql := "issueFunction in linkedIssuesOf('key =" . IssueKey . "'," . linkNames . ")" - -sRootUrl := Jira_GetRootUrl() -sUrl := sRootUrl . "/issues/?jql=" . sJql -Run, %sUrl% - - +Jira_OpenJql(sJql) } ; eofun ; ------------------------------------------------------------------------------------------------------------------- diff --git a/Lib/R4J.ahk b/Lib/R4J.ahk index de9849e..f7b4c87 100644 --- a/Lib/R4J.ahk +++ b/Lib/R4J.ahk @@ -107,11 +107,13 @@ R4J_OpenIssue(sIssueKey) { Atlasy_OpenUrl(sUrl) } ; eofun +; --------------------------------------------------------------------------------- R4J_J2R(sIssueKey) { R4J_OpenIssue(sIssueKey) } ; eofun +; --------------------------------------------------------------------------------- R4J_OpenProject(sProjectKey,view := "d",JiraRootUrl:="") { ; Open project R4J tree @@ -123,7 +125,6 @@ R4J_OpenProject(sProjectKey,view := "d",JiraRootUrl:="") { } Else ; server/dc sUrl := JiraRootUrl . "/plugins/servlet/com.easesolutions.jira.plugins.requirements" - Switch view { Case "d","doc","tree": If InStr(JiraRootUrl,".atlassian.net") @@ -228,7 +229,6 @@ return sUrl ; ------------------------------------------------------------------------------------------------------------------- - R4J_Arch_OpenIssueSelection() { ; Called by Hotkey Ctrl+Shift+V ClipSaved := ClipboardAll @@ -273,6 +273,8 @@ return SubStr(sIssueKeyList,1,-1) ; remove ending ; R4J_CopyPathJql(sIssueKey:="") { sJql := R4J_GetPathJql(sIssueKey) + If (sJql="") ; Cancel + return Clipboard := sJql TrayTipAutoHide("R4J PowerTool","Jql '" . sJql . "' was copied to the clipboard!") } ; eofun @@ -286,7 +288,7 @@ R4J_OpenPathJql(sIssueKey:="") { return } jiraRootUrl := Jira_GetRootUrl() - IsCloud := Jira_IsCloud(jiraRootUrl ) + IsCloud := Jira_IsCloud(jiraRootUrl) If !InStr(sIssueKey,"-") { ; root level If (IsCloud) sJql := "r4jPath in ('" . sIssueKey . "')" @@ -303,6 +305,38 @@ R4J_OpenPathJql(sIssueKey:="") { } ; eofun ; ------------------------------------------------------------------------------------------------------------------- +R4J_CopyChildrenJql() { ; @fun_r4j_CopyChildrenJql@ +If GetKeyState("Ctrl") and !GetKeyState("Shift") { ; open help + PowerTools_OpenDoc("r4j_CopyChildrenJql") + return +} +issueKeys := Jira_GetIssueKeys() +IsCloud := Jira_IsCloud(jiraRootUrl) +/* +If (issueKeys.Length() > 1) { + op := ButtonBox("Jql combine","Choose your logical operator:","OR|AND") + If ( op = "ButtonBox_Cancel") or ( op = "Timeout") + return +} +*/ +op := "OR" +for index, Key in issueKeys +{ + If (IsCloud) + Jql_i := "r4jPath in ('" . Key . "')" + Else + Jql_i := "issue in requirementsPath('" . Key . "')" + If (index=1) + Jql := Jql_i + Else + Jql := Jql . " " . op . " " . Jql_i +} ; end for +Clipboard := Jql +TrayTipAutoHide("R4J PowerTool","Jql '" . Jql . "' was copied to the clipboard!") +} ; eofun +; ------------------------------------------------------------------------------------------------------------------- +; ------------------------------------------------------------------------------------------------------------------- + R4J_GetPathJql(sIssueKey:="") { If GetKeyState("Ctrl") and !GetKeyState("Shift") { ; open help @@ -317,16 +351,19 @@ If (sIssueKey="") { return } -IsCloud := Jira_IsCloud() ; check before ListBox to keep browser window active - -sPath := R4J_GetPath(sIssueKey) -If !sPath ; empty=error - return -; Select Path : to issue or parent issue -sPath := ListBox("R4J Get Path","Choose path to use:",sPath . "/" . sIssueKey . "|" . sPath ,1) -If (sPath="") ; check if cancel - return +If !InStr(sIssueKey,"-") ; root level + sPath := sIssueKey +Else { + sPath := R4J_GetPath(sIssueKey) + If !sPath ; empty=error + return + ; Select Path : to issue or parent issue + sPath := ListBox("R4J Get Path","Choose path to use:",sPath . "/" . sIssueKey . "|" . sPath ,1) + If (sPath="") ; check if cancel + return +} +IsCloud := Jira_IsCloud() ; check before ListBox to keep browser window active If (IsCloud) sJql := "r4jPath in ('" . sPath . "')" Else @@ -559,6 +596,10 @@ If (sIssueKey="") { TrayTip, Error, Jira Issue could not be identified!,,3 return } + +If !InStr(sIssueKey,"-") ; root level + return sIssueKey + If (sProjectKey="") { If Browser_IsWinActive() { sUrl := Browser_GetUrl() @@ -1185,6 +1226,14 @@ If GetKeyState("Ctrl") { return } +JiraRootUrl := Jira_GetRootUrl() +If (JiraRootUrl = "") + return +If Jira_IsCloud(JiraRootUrl) { + PowerTools_ErrDlg("Coverage Report is not implemented for Cloud version!") + return +} + static S_CR_DestFolder := A_ScriptDir static S_JsonFile := "r4j" @@ -1194,9 +1243,7 @@ If (JiraPassword = "") ; cancel return EnvSet, JIRA_PASSWORD, %JiraPassword% -JiraRootUrl := Jira_GetRootUrl() -If (JiraRootUrl = "") - return + EnvSet, JIRA_HOST_URL, %JiraRootUrl% JiraUserName := Jira_GetUserName() @@ -1298,7 +1345,6 @@ IfMsgBox Yes infoSheet.Range("B" . nRow).Formula := sFormula ; escape quotes sFormula = =SUBSTITUTE(CONCAT('%SheetName%'!4:4),"Coverage:","") infoSheet.Range("C" . nRow).Formula := sFormula - srcWorkbook.Close(False) } Else { ; Fill Info sheet diff --git a/docs/_pages/Atlasy-Changelog.md b/docs/_pages/Atlasy-Changelog.md index c1effa1..98a549d 100644 --- a/docs/_pages/Atlasy-Changelog.md +++ b/docs/_pages/Atlasy-Changelog.md @@ -4,9 +4,37 @@ title: "Atlasy Changelog" excerpt: "Release notes for Atlasy PowerTool." --- -[Atlasy](Atlasy) Changelog +[Atlasy.md](Atlasy) Changelog +See also [e.CoSys PowerTool Changelog](e.CoSys-PowerTool-Changelog.md) + +* 2024-02-19 + * Added: BitBucket keyword +* 2024-02-13 + * Fix: j f : open filter. add quotes for name wiht space (jira bug) e.g. j f THB Project +* 2024-02-12 + * Fix Jira Quick Search +* 2024-02-07 + * R4J: -f open issue navigator, r4jpath filter + * Confluence Quick Open +* 2023-12-13 + * Confluence Cloud Space search + * j $key: open issue or project + * j : open selected issues +* 2023-11-29 + * Jira -s, -b, -f commands +* 2023-11-21 + * R4J -cv: copy coverage views + * BP open BigPicture + * Keywords -p and -pl to Switch Project / edit Project list resp. +* 2023-11-17 + * Jira/ R4J/ Xray Quick Open takes root url from current Jira browser window (switch cloud/server) +* 2023-11-09 + * e.CoSys Project as Setting + * Xray: keyword 't'|'x' with subkeyword 'r', 'e' and 'p' to open Xray test repository (server and cloud), test executions and plans + * R4J: added subkeywords 'c','t' for coverage and traceability * 2023-10-04 + * 'j' switch from R4J to Jira issue detailed view * Hotkey settings for OpenIssue and OpenIssueDoc * 2023-09-29 * Confluence Quick navigate to space diff --git a/docs/_pages/Atlasy.md b/docs/_pages/Atlasy.md index eedd6b6..465241a 100644 --- a/docs/_pages/Atlasy.md +++ b/docs/_pages/Atlasy.md @@ -1,96 +1,197 @@ ---- -permalink: /Atlasy -title: "Atlasy" -redirect_from: - - /atlasy -excerpt: "Atlassian Launcher and Commander" ---- +- [About](#about) +- [Main Tool Page](#main-tool-page) +- [Prerequisites](#prerequisites) +- [Commands/ Keywords](#commands-keywords) + - [Main Keywords](#main-keywords) + - [Jira](#jira) + - [Jira Quick Search](#jira-quick-search) + - [Confluence](#confluence) + - [Confluence Quick Open](#confluence-quick-open) + - [R4J](#r4j) + - [Xray](#xray) + - [Doc](#doc) + - [BigPicture](#bigpicture) + - [BitBucket](#bitbucket) + - [e.CoSys](#ecosys) +- [Changelog](#changelog) -## About -This is currently a Work-In-Progress. -If attention is attracted and resonance is high (interest shown by personal feedback or comment), this project will be better documented and shared. +## About Atlasy is a tool that enables your working within the Atlassian-based tools like Jira, Confluence, R4J etc. It adds some UX related features and also extended capability. -You can run its features from an integrated Launcher with natural keywords and commands or via a menu or hotkeys. +You can run its features from an integrated Launcher with natural keywords and commands. Short Feature highlights include: * bulk linking between Jira issues * quick search (Jira, Confluence) - * quick navigation (e.g. R4J tree) + * quick navigation (e.g. R4J, Xray) * quick set an epic * ... -## [Main Blog Post](https://tdalon.blogspot.com/2023/09/atlasy-new-powertool.html) - -

+## [Main Tool Page](https://etelligent.atlassian.net/wiki/spaces/PMT/pages/105914745/Atlasy+-+Atlassian+Launcher+and+Commander) -See [all blog posts tagged with #atlasy](https://tdalon.blogspot.com/search/label/atlasy). ## Prerequisites -Atlasy is available as AutoHotkey scripts but also as standalone compiled .exe application. [Download link](https://github.com/tdalon/ahk/raw/main/PowerTools/Atlasy.exe) +Atlasy is included with the [e.CoSys PowerTool](https://etelligent.atlassian.net/wiki/spaces/PMT/pages/105913155/e.CoSys+PowerTool) -## List of supported commands/ Keywords +## Commands/ Keywords -This is implemented in the main associated library [Lib/Atlasy.ahk](https://github.com/tdalon/ahk/blob/main/Lib/Atlasy.ahk). +This is implemented in the main associated library [Lib/Atlasy.ahk](../Lib/Atlasy.ahk). In the source code you can find the full up to date syntax for keywords and command. (I hope the code is clear enough.) -### Examples +### Main Keywords + +Keyword | Action +--|-- +c | [Confluence](#confluence) +j | [Jira](#jira) +r | [R4J](#r4j) +x | [Xray](#xray) +bb | [BitBucket](#bitbucket) +sw | switch between server and cloud (bidirectional) +e | [e.CoSys](ecosys) + + +### Jira + +Launcher Primary Keyword: 'j' + +Secondary Keyword | Action +--|-- +| If R4J window, open current Issue in Jira
+Open Selected or current Issues or Jira Root Url (if none) +Key | Open Project or Issue +-dp * | Edit / Set Default Project +-p * | Navigate to Project +-pl | Edit Project List +-s | Open New Search window +-s or -i | Open new search (Issues) prefilled with Jql. Supports Quick Search shortcuts. +-b | Open Boards +-f | Open Filters +-l or l | Add Link +b | bulk edit selected or current issues +n | open selected or current issues in Navigator / Filter view +-c or c * | Open Full window Create Issue Screen. Project Key will be prefilled if passed as optional argument +h or -h * | Open Help for command (if implemented) +? | Open list of commands (this page) + + +#### Jira Quick Search + +Keyword | Jql +--|-- +s~ | summary~ +d~ | description~ +-a | assigned to me (assignee = currentUser()) +-c | created by me (creator = currentUser()) +-u | unresolved (resolution = Unresolved) +-ua | unassigned (assignee is EMPTY) +-r | reported by me (reporter = currentUser()) +-w | watched by me (watcher = currentUser()) +#(label) | labels = label -The list below might not be exhaustive. Look at the code for the full up to date implementation. + +### Confluence + +Launcher Keyword: 'c' Keywords | Action --|-- -r | r4j -c | Confluence -j | Jira +| Open Confluence Root Url + | Open Confluence Space at Home + | Search in Space for query +o or -o | [Quick Open](#Quick Open) -
+ +#### Confluence Quick Open -## Download ## +s or -s followed by to restrict search in a Space +query: use # for search by label. You can combine multiple labels e.g. #label1 #label2 ; it will then search by AND i.e. intersection. +query can contain also keywords -You can download the portable standalone compiled .exe here: [Download Atlasy.exe](https://github.com/tdalon/ahk/raw/main/PowerTools/Atlasy.exe) +Quick Open will open the first page found by the Search. -The source code is available here: https://github.com/tdalon/ahk + +### R4J -## Feature Highlights +Main keyword 'r' -### Jira Integration +Second Keyword or Command | Action +--|-- +| from Jira issue detailed view-> Open issue in R4J Tree + ProjectKey or IssueKey | Open Issue or Project R4J view + : d (document, tree) or c (coverage) or t (traceability) +-cp or cp | Copy Path Jql +-cc or cc | Copy Children Jql +-p or p | Transform and paste server Jql to Cloud Jql +-n or n | open in Issue navigator r4j path +-cv or -tv | Coverage or Traceability View commands +    c (default) | Copy +    i | Import +    e | Export -### R4J Integration -#### Launcher +### Xray -Launcher Keyword: 'r' +Main keyword 'x' -##### Quick Open Project in R4J Tree +2nd Keyword | Action +--|-- + | Open Xray Getting Started page +r | Test repository +e | Test execution +p | Test plans +m | Test Plans Metrics +trace | Traceability Report +t | Tests List Report +ts | Test Sets Report +tp | Test Plan Report +te | Test Executions Report +tr | Test Run Report +[doc](#doc) | Open Xray documentation +gs | Open Xray Getting Started page + +#### Doc + +3nd keyword | Page +--|-- +| Open main documentation page +rn | Release Notes +gs | Getting Started -r ProjectKey -r IssueKey -r from Jira issue detailed view-> Open issue in R4J Tree + +### BigPicture -#### Hotkey to switch from detailed issue view and tree view +Main keyword is 'bp' +Opens BigPicture. + +### BitBucket -## YouTube Playlist +Main keyword: 'bb' - +Will use default EC Project -## Source Code + +### e.CoSys -The main ahk file is [Atlasy.ahk](https://github.com/tdalon/ahk/blob/main/Atlasy.ahk) +Main keyword 'e' -Main associated libraries are: - * [Lib/Jira.ahk](https://github.com/tdalon/ahk/blob/main/Lib/Jira.ahk) - * [Lib/Confluence.ahk](https://github.com/tdalon/ahk/blob/main/Lib/Confluence.ahk) - * [Lib/R4J.ahk](https://github.com/tdalon/ahk/blob/main/Lib/R4J.ahk) +2nd Keyword | Action +--|-- +p or -p | Edit e.CoSys Project +pl or -pl | Edit e.CoSys Project List + + +
-## [Changelog](Atlasy-Changelog) + +## Changelog -## [News](https://twitter.com/search?q=%23Atlasy) +See [Atlasy Changelog](Atlasy-Changelog.md)