Reputation: 167
I am creating a script to do a Pull request using the below Azure CLI script.
az repos pr create --description $PR_Description --merge-commit-message $PR_WorkItemNo --org $orgname --source-branch $PatchName --target-branch "main" --title $PR_Title --project $projectname --repository $PR_repository --work-items $linkedworkitemno
Assigning a single work item (eg "72076") to this variable $linkedworkitemno - works fine and associates the single work item to the PR.
But when I add two work items with space (eg "72076 72126") - as explained in MS Docs (- --work-items - IDs of the work items to link to the new pull request. Space separated https://learn.microsoft.com/en-us/cli/azure/repos/pr?view=azure-cli-latest#az_repos_pr_create), it is not linking both items to the PR and only associates the FIRST work item.
can you please help me with this query?
Upvotes: 1
Views: 361
Reputation: 40673
Please to it as follows:
$linkedworkitemno = @('72076', '72126')
and then:
--work-items $linkedworkitemno
Upvotes: 2