Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/AzSK.ADO/Framework/BugLog/AutoBugLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class AutoBugLog {
#Obtain area and iteration paths
$AreaPath = [BugLogPathManager]::GetAreaPath()
$IterationPath = [BugLogPathManager]::GetIterationPath()

$BugLoggingProject = [BugLogPathManager]::GetBugLoggingProject() #This project should be used to check if current bug exists or not

#this falg is added to restrict 'Determining bug logging' message should print only once
$printLogBugMsg = $true;
#Loop through all the control results for the current resource
Expand All @@ -68,7 +69,7 @@ class AutoBugLog {
#compute hash of control Id and resource Id
$hash = $this.GetHashedTag($control.ControlItem.Id, $control.ResourceContext.ResourceId)
#check if a bug with the computed hash exists
$workItem = $this.GetWorkItemByHash($hash, $ProjectName)
$workItem = $this.GetWorkItemByHash($hash, $BugLoggingProject)
if ($workItem[0].results.count -gt 0) {
#a work item with the hash exists, find if it's state and reactivate if resolved bug
$this.ManageActiveAndResolvedBugs($ProjectName, $control, $workItem, $AssignedTo)
Expand Down
9 changes: 8 additions & 1 deletion src/AzSK.ADO/Framework/BugLog/BugLogPathManager.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class BugLogPathManager {
hidden static [bool] $checkValidPathFlag = $true;
#flag to check if the path that has been declared is valid
hidden static [bool] $isPathValid = $false;
#variable to store the actual project where bug is supposed to log
hidden static [string] $BugLoggingProject = $null


#function to find if the area and iteration path are valid
Expand Down Expand Up @@ -42,7 +44,9 @@ class BugLogPathManager {
#sanitizing for JSON
[BugLogPathManager]::AreaPath = [BugLogPathManager]::AreaPath.Replace("\", "\\")
[BugLogPathManager]::IterationPath = [BugLogPathManager]::IterationPath.Replace("\", "\\")

# AreaPath always Starts with Project
[BugLogPathManager]::BugLoggingProject = [BugLogPathManager]::AreaPath.split("\")[0]

#copying the value for easy inputting to the query JSON
$AreaPathForJSON = [BugLogPathManager]::AreaPath
$IterationPathForJSON = [BugLogPathManager]::IterationPath
Expand Down Expand Up @@ -84,4 +88,7 @@ class BugLogPathManager {
static hidden [bool] GetIsPathValid(){
return [BugLogPathManager]::isPathValid
}
static hidden [string] GetBugLoggingProject(){
return [BugLogPathManager]::BugLoggingProject
}
}