public/api-v2/issue/Invoke-JiraGetDeployments.ps1

#https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-get
function Invoke-JiraGetDeployments {
    param (
        # The ID of the issue
        [Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
        [int32]
        $Id
    )
    begin {
        $results = @()
    }
    process {
        $functionPath = "/jsw/graphql"
        $verb = "POST"

        $query = New-PACRestMethodQueryParams @{
            operation = "DevDetailsDialog"
        }

        $gqlQuery = @'
query DevDetailsDialog ($issueId: ID!) {
    developmentInformation(issueId: $issueId){
        details {
            deploymentProviders {
                deployments {
                    displayName
                    url
                    state
                    lastUpdated
                    pipelineId
                    pipelineDisplayName
                    pipelineUrl
                    environment {
                        id
                        type
                        displayName
                    }
                }
            }
        }
    }
}
'@


        $body = New-PACRestMethodJsonBody @{
            operationName = "DevDetailsDialog"
            query         = $gqlQuery
            variables     = @{
                issueId = $Id
            }
        }

        $method = New-PACRestMethod $functionPath $verb $query $body 
        $results += $method.Invoke($JiraContext)
    }
    end {
        $results.data.developmentInformation.details.deploymentProviders.deployments
    }
}