Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create inherited processes via CLI #23760

Open
silverscout opened this issue Sep 1, 2022 · 5 comments
Open

Create inherited processes via CLI #23760

silverscout opened this issue Sep 1, 2022 · 5 comments
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. DevOps Service Attention This issue is responsible by Azure service team.

Comments

@silverscout
Copy link

was wondering if there is a set of arguments that allow for Creation of inherited processes? I have searched everywhere.
If not, I am having a hard time invoking the webservice command do it. I can do it via normal Rest API. However, I would like to run the whole script using Azure CLI and not jump back and forth.

Here is the script I am running. Also, why does it have to be a file.. why can't it be a variable


$createProcessURL = "$orgUrl/_apis/work/processes?api-version=6.0-preview.2"

$ProcessTemplate = @{name = "Agile - $($proj)";parentProcessTypeId = "adcc42ab-9882-485e-a3ed-7678f01f66bc";referenceName = "$($projectName).MyNewAgileProcess";description = "My new process"} | ConvertTo-Json

#$response = Invoke-RestMethod -Uri $createProcessURL -Method Post -ContentType "application/json" -Headers $header -Body ($ProcessTemplate)

$ProcessTemplate | Out-File -FilePath "C:\PS Testing\body.json"

 
 az devops invoke `
 --area process `
 --accept-media-type "application/json" `
 --api-version=6.0-preview `
 --http-method "post" `
 --org "https://dev.azure.com/silverscout" `
 --in-file  "C:\PS Testing\body.json"

Error I am getting..

az : ERROR: Unable to decode file  'C:\PS Testing\body.json' with 'utf-8' encoding.
At line:5 char:1
+ az devops invoke `
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (ERROR: Unable t...tf-8' encoding.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot CXP Attention This issue is handled by CXP team. DevOps labels Sep 1, 2022
@SaurabhSharma-MSFT SaurabhSharma-MSFT self-assigned this Sep 1, 2022
@SaurabhSharma-MSFT
Copy link
Member

@silverscout We are looking into it and get back to you for any additional information.

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 1, 2022

route to CXP team

@silverscout
Copy link
Author

@yonzhan and @SaurabhSharma-MSFT

I solved the issue with the invoke. actually someone else did. can someone please look at "Azure/azure-devops-cli-extension#1011 (comment)" and put a suitable fix for this?

Thanks David.

@SaurabhSharma-MSFT SaurabhSharma-MSFT removed the CXP Attention This issue is handled by CXP team. label Sep 26, 2022
@SaurabhSharma-MSFT
Copy link
Member

@gauravsaralMs Can you please look into this.

@SaurabhSharma-MSFT SaurabhSharma-MSFT added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2022
@ghost
Copy link

ghost commented Sep 26, 2022

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @v-anvashist, @V-hmusukula.

Issue Details

was wondering if there is a set of arguments that allow for Creation of inherited processes? I have searched everywhere.
If not, I am having a hard time invoking the webservice command do it. I can do it via normal Rest API. However, I would like to run the whole script using Azure CLI and not jump back and forth.

Here is the script I am running. Also, why does it have to be a file.. why can't it be a variable


$createProcessURL = "$orgUrl/_apis/work/processes?api-version=6.0-preview.2"

$ProcessTemplate = @{name = "Agile - $($proj)";parentProcessTypeId = "adcc42ab-9882-485e-a3ed-7678f01f66bc";referenceName = "$($projectName).MyNewAgileProcess";description = "My new process"} | ConvertTo-Json

#$response = Invoke-RestMethod -Uri $createProcessURL -Method Post -ContentType "application/json" -Headers $header -Body ($ProcessTemplate)

$ProcessTemplate | Out-File -FilePath "C:\PS Testing\body.json"

 
 az devops invoke `
 --area process `
 --accept-media-type "application/json" `
 --api-version=6.0-preview `
 --http-method "post" `
 --org "https://dev.azure.com/silverscout" `
 --in-file  "C:\PS Testing\body.json"

Error I am getting..

az : ERROR: Unable to decode file  'C:\PS Testing\body.json' with 'utf-8' encoding.
At line:5 char:1
+ az devops invoke `
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (ERROR: Unable t...tf-8' encoding.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
Author: silverscout
Assignees: SaurabhSharma-MSFT
Labels:

Service Attention, customer-reported, DevOps, Auto-Assign

Milestone: -

@SaurabhSharma-MSFT SaurabhSharma-MSFT removed their assignment Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. DevOps Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants