public/api-v2/workflow/Invoke-JiraUpdateDefaultWorkflow.ps1
#https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-workflowscheme-id-default-put function Invoke-JiraUpdateDefaultWorkflow { [CmdletBinding()] param ( # The ID of the scheme to update [Parameter(Mandatory,Position=0)] [int64] $SchemeId, # The name of the workflow to set as default. Will be set to the default jira workflow if not specified. [Parameter(Mandatory,Position=1)] [string] $DefaultWorkflow, # Set this flag to update a draft if the workflow is currently being used [Parameter()] [switch] $UpdateDraft, # The JiraContext object to use for the request [Parameter()] [object] $JiraContext ) process { $functionPath = "/rest/api/2/workflowscheme/$SchemeId/default" $verb = "PUT" $body = New-PACRestMethodJsonBody @{ workflow = $DefaultWorkflow } if($PSBoundParameters.ContainsKey("UpdateDraft")){$query.Add("updateDraftIfNeeded",$true)} $method = New-PACRestMethod $functionPath $verb $null $body $method.Invoke($JiraContext) } } |