AtlassianPS / JiraPS

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

Add-JiraRemoteLink Allows Adding Remote Links #424

Open bormm opened 3 years ago

bormm commented 3 years ago

Picket the "patch zip" from #375 and created a extended version and a pull request.

Description

This adds the Add-JiraRemoteLink function from #375 in a massive extended version. Due the original one only allowed url and txt attribute, I used the format defined by Get-JiraRemoteLink. For that I also created a ConvertFrom-JiraLink as counterpart to the existing ConvertTo-JiraLink.

Motivation and Context

I do not understand why there was a format change of the incoming JSON, as done in Get-JiraRemoteLink, in this case useful anyway but that's an other discussion and I wanted the change to be compatible to the existing stuff as possible.

As the previous discussed original, this only allows adding additional remote links, which is also reflected in the naming of the function. For that the function verifies that there is no Id or RestUrl in the object, because that would only make sense for updating existing remote links and could confuse the user of this function.

Types of changes

Checklist

bormm commented 3 years ago

There are no tests and documentation currently, I am not sure if I am able to add them in my very limited work time for this project. So I would be happy if someone could extend my pull request with that.