< Back

Remove-JiraIssueAttachment

Thu Jan 16, 2020 8:13 am

NAME Remove-JiraIssueAttachment



SYNOPSIS

Removes an attachment from a JIRA issue





SYNTAX

Remove-JiraIssueAttachment [-AttachmentId] <Int32[]> [-Credential <PSCredential>] [-Force] [-WhatIf] [-Confirm]

[<CommonParameters>]



Remove-JiraIssueAttachment [-Issue] <Object> [-FileName <String[]>] [-Credential <PSCredential>] [-Force]

[-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

This function removes an attachment from a JIRA issue.





PARAMETERS

-AttachmentId <Int32[]>

Id of the Attachment to delete



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Issue <Object>

Issue from which to delete on or more attachments.



Can be a `JiraPS.Issue` object, issue key, or internal issue ID.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-FileName <String[]>

Name of the File to delete



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

Credentials to use to connect to JIRA.

If not specified, this function will use anonymous access.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Suppress user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

[JiraPS.Issue] / [String] / [Int]







OUTPUTS



NOTES





This function requires either the `-Credential` parameter to be passed or a persistent JIRA session. See

`New-JiraSession` for more details. If neither are supplied, this function will run with anonymous access to

JIRA.



-------------------------- EXAMPLE 1 --------------------------



Remove-JiraIssueAttachment -AttachmentId 10039



Removes attachment with id of 10039

-------------------------- EXAMPLE 2 --------------------------



Get-JiraIssueAttachment -Issue FOO-1234 | Remove-JiraIssueAttachment



Removes all attachments from issue FOO-1234

-------------------------- EXAMPLE 3 --------------------------



Remove-JiraIssueAttachment -Issue FOO-1234 -FileName '*.png' -force



Removes all *.png attachments from Issue FOO-1234 without prompting for confirmation



RELATED LINKS

Online Version: https://atlassianps.org/docs/JiraPS/com ... ttachment/

Add-JiraIssueAttachment

Get-JiraIssue

Get-JiraIssueAttachment