AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
322 stars 131 forks source link

Add-JiraIssueAttachment.ps1 failing with URL error - This operation is not supported for a relative URI. #397

Open amitmtank opened 4 years ago

amitmtank commented 4 years ago

Description

Add-JiraIssueAttachment.ps1 failing with URL error - This operation is not supported for a relative URI.

        [Uri]$Uri = $Uri.GetLeftPart("Path")
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
       FullyQualifiedErrorId : InvalidOperationException

Possible Solution

Probably because no resolvable function Resolve-JiraIssueObject @ line 86 of https://github.com/AtlassianPS/JiraPS/blob/master/JiraPS/Public/Add-JiraIssueAttachment.ps1 and need Get-JiraIssue instead.

    $issueObj = Resolve-JiraIssueObject -InputObject $Issue -Credential $Credential
amitmtank commented 4 years ago

I see it's in private but not sure why it's not resolving the URL with that function then...

lipkau commented 4 years ago

Please provide more context on the error and on how you are running the command.

My test is working fine image