Skip to content

Commit

Permalink
moving assignment up
Browse files Browse the repository at this point in the history
  • Loading branch information
joshjohanning authored Mar 10, 2022
1 parent 3f697fd commit 79dc6c4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ado_workitems_to_github_issues.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ ForEach($workitem in $query) {
# create the issue
$issue_url=gh issue create --body-file ./temp_issue_body.txt --repo "$gh_org/$gh_repo" --title $details.fields.{System.Title} --label $work_item_type
write-host "issue created: $issue_url"

# update assigned to in GitHub if the option is set - tries to use ado email to map to github username
if ($gh_update_assigned_to -eq $true -and $ado_assigned_to_unique_name -ne "") {
$gh_assignee=$ado_assigned_to_unique_name.Split("@")[0]
$gh_assignee=$gh_assignee.Replace(".", "-") + $gh_assigned_to_user_suffix
write-host "trying to assign to: $gh_assignee"
$assigned=gh issue edit $issue_url --add-assignee "$gh_assignee"
}

# add the comment
$comment_url=gh issue comment $issue_url --body-file ./temp_comment_body.txt
Expand All @@ -155,12 +163,5 @@ ForEach($workitem in $query) {
if ($details.fields.{System.State} -eq "Done" -or $details.fields.{System.State} -eq "Closed") {
gh issue close $issue_url
}

# update assigned to in GitHub if the option is set - tries to use ado email to map to github username
if ($gh_update_assigned_to -eq $true -and $ado_assigned_to_unique_name -ne "") {
$gh_assignee=$ado_assigned_to_unique_name.Split("@")[0]
$gh_assignee=$gh_assignee.Replace(".", "-") + $gh_assigned_to_user_suffix
write-host "trying to assign to: $gh_assignee"
$assigned=gh issue edit $issue_url --add-assignee "$gh_assignee"
}

}

0 comments on commit 79dc6c4

Please sign in to comment.