Skip to content

Commit

Permalink
Release v2.12
Browse files Browse the repository at this point in the history
Merge pull request #371 from lipkau/release/v2.12
  • Loading branch information
lipkau authored Aug 15, 2019
2 parents 9786aa0 + 39e17ec commit ce55dcd
Show file tree
Hide file tree
Showing 29 changed files with 1,473 additions and 246 deletions.
61 changes: 38 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## [NEXT VERSION] - YYYY-MM-DD

## [2.12] - 2019-08-15

### Added

- Added cmdlet for sorting versions: `Move-JiraVersion` (#363, [@kb-cs])
- Added cmdlet for finding filters by name: `Find-JiraFilter` (#365, [@vercellone])

### Changed

- Changed the way users as interpreted by functions (#369, [@lipkau])
- Changed how the config of a jira server is stored (#370, [@lipkau])

## [2.11] - 2019-07-02

### Added
Expand Down Expand Up @@ -322,26 +334,29 @@ which is in turn inspired by the [Vagrant](https://github.com/mitchellh/vagrant/
### Fixed

<!-- reference-style links -->
[@alexsuslin]: https://github.com/alexsuslin
[@axxelG]: https://github.com/axxelG
[@beaudryj]: https://github.com/beaudryj
[@brianbunke]: https://github.com/brianbunke
[@Clijsters]: https://github.com/Clijsters
[@ctolan]: https://github.com/ctolan
[@colhal]: https://github.com/colhal
[@Dejulia489]: https://github.com/Dejulia489
[@ebekker]: https://github.com/ebekker
[@hmmwhatsthisdo]: https://github.com/hmmwhatsthisdo
[@jkknorr]: https://github.com/jkknorr
[@kittholland]: https://github.com/kittholland
[@LiamLeane]: https://github.com/LiamLeane
[@lipkau]: https://github.com/lipkau
[@lukhase]: https://github.com/lukhase
[@michalporeba]: https://github.com/michalporeba
[@mirrorgleam]: https://github.com/mirrorgleam
[@nojp]: https://github.com/nojp
[@padgers]: https://github.com/padgers
[@ThePSAdmin]: https://github.com/ThePSAdmin
[@tuxgoose]: https://github.com/tuxgoose
[@WindowsAdmin92]: https://github.com/WindowsAdmin92
[@wisemoth]: https://github.com/wisemoth

[@alexsuslin]: https://github.com/alexsuslin
[@axxelg]: https://github.com/axxelG
[@beaudryj]: https://github.com/beaudryj
[@brianbunke]: https://github.com/brianbunke
[@clijsters]: https://github.com/Clijsters
[@ctolan]: https://github.com/ctolan
[@colhal]: https://github.com/colhal
[@dejulia489]: https://github.com/Dejulia489
[@ebekker]: https://github.com/ebekker
[@hmmwhatsthisdo]: https://github.com/hmmwhatsthisdo
[@jkknorr]: https://github.com/jkknorr
[@kb-cs]: https://github.com/kb-cs
[@kittholland]: https://github.com/kittholland
[@liamleane]: https://github.com/LiamLeane
[@lipkau]: https://github.com/lipkau
[@lukhase]: https://github.com/lukhase
[@michalporeba]: https://github.com/michalporeba
[@mirrorgleam]: https://github.com/mirrorgleam
[@nojp]: https://github.com/nojp
[@padgers]: https://github.com/padgers
[@thepsadmin]: https://github.com/ThePSAdmin
[@tuxgoose]: https://github.com/tuxgoose
[@vercellone]: https://github.com/vercellone
[@windowsadmin92]: https://github.com/WindowsAdmin92
[@wisemoth]: https://github.com/wisemoth
32 changes: 16 additions & 16 deletions JiraPS/JiraPS.psd1
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
@{

# Script module or binary module file associated with this manifest.
RootModule = 'JiraPS.psm1'
RootModule = 'JiraPS.psm1'

# Version number of this module.
ModuleVersion = '2.11'
ModuleVersion = '2.12'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '4bf3eb15-037e-43b7-9e47-20a30436324f'
GUID = '4bf3eb15-037e-43b7-9e47-20a30436324f'

# Author of this module
Author = 'AtlassianPS'
Author = 'AtlassianPS'

# Company or vendor of this module
CompanyName = 'AtlassianPS.org'
CompanyName = 'AtlassianPS.org'

# Copyright statement for this module
Copyright = '(c) 2017 AtlassianPS. All rights reserved.'
Copyright = '(c) 2017 AtlassianPS. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Windows PowerShell module to interact with Atlassian JIRA'
Description = 'Windows PowerShell module to interact with Atlassian JIRA'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
PowerShellVersion = '3.0'

# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''
Expand Down Expand Up @@ -55,22 +55,22 @@
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = 'JiraPS.format.ps1xml'
FormatsToProcess = 'JiraPS.format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = '*'
FunctionsToExport = '*'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = '*'
AliasesToExport = '*'

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand All @@ -79,15 +79,15 @@
# ModuleList = @()

# List of all files packaged with this module
FileList = @()
FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = @(
Tags = @(
"powershell",
"powershell-gallery",
"readthedocs",
Expand All @@ -105,7 +105,7 @@
ProjectUri = 'https://AtlassianPS.org/module/JiraPS'

# A URL to an icon representing this module.
IconUri = 'https://AtlassianPS.org/assets/img/JiraPS.png'
IconUri = 'https://AtlassianPS.org/assets/img/JiraPS.png'

# ReleaseNotes of this module
# ReleaseNotes = ''
Expand Down
9 changes: 8 additions & 1 deletion JiraPS/JiraPS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ if (!("System.Net.Http" -as [Type])) {
#endregion Dependencies

#region Configuration
$script:serverConfig = ("{0}/AtlassianPS/JiraPS/server_config" -f [Environment]::GetFolderPath('ApplicationData'))

if (-not (Test-Path $script:serverConfig)) {
$null = New-Item -Path $script:serverConfig -ItemType File -Force
}
$script:JiraServerUrl = [Uri](Get-Content $script:serverConfig)

$script:DefaultContentType = "application/json; charset=utf-8"
$script:DefaultPageSize = 25
$script:DefaultHeaders= @{ "Accept-Charset" = "utf-8" }
$script:DefaultHeaders = @{ "Accept-Charset" = "utf-8" }
# Bug in PSv3's .Net API
if ($PSVersionTable.PSVersion.Major -gt 3) {
$script:DefaultHeaders["Accept"] = "application/json"
Expand Down
8 changes: 4 additions & 4 deletions JiraPS/Private/Resolve-JiraIssueObject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ function Resolve-JiraIssueObject {
# to extract the data from a JiraPS.Issue object
# This shall be removed once we have custom classes for the module
if ("JiraPS.Issue" -in $InputObject.PSObject.TypeNames -and $InputObject.RestURL) {
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] Using `$Issue as object"
return $Issue
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] Using `$InputObject as object"
return $InputObject
}
elseif ("JiraPS.Issue" -in $InputObject.PSObject.TypeNames -and $InputObject.Key) {
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] Resolve Issue to object"
return Get-JiraIssue -Key $InputObject.Key -Credential $Credential -ErrorAction Stop
return (Get-JiraIssue -Key $InputObject.Key -Credential $Credential -ErrorAction Stop)
}
else {
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] Resolve Issue to object"
return Get-JiraIssue -Key $InputObject.ToString() -Credential $Credential -ErrorAction Stop
return (Get-JiraIssue -Key $InputObject.ToString() -Credential $Credential -ErrorAction Stop)
}
}
50 changes: 50 additions & 0 deletions JiraPS/Private/Resolve-JiraUser.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
function Resolve-JiraUser {
<#
#ToDo:CustomClass
Once we have custom classes, this will no longer be necessary
#>
[CmdletBinding()]
param(
[Parameter( ValueFromPipeline )]
[ValidateNotNullOrEmpty()]
[ValidateScript(
{
if (("JiraPS.User" -notin $_.PSObject.TypeNames) -and (($_ -isnot [String]))) {
$exception = ([System.ArgumentException]"Invalid Type for Parameter") #fix code highlighting]
$errorId = 'ParameterType.NotJiraUser'
$errorCategory = 'InvalidArgument'
$errorTarget = $_
$errorItem = New-Object -TypeName System.Management.Automation.ErrorRecord $exception, $errorId, $errorCategory, $errorTarget
$errorItem.ErrorDetails = "Wrong object type provided for User. Expected [JiraPS.User] or [String], but was $($_.GetType().Name)"
$PSCmdlet.ThrowTerminatingError($errorItem)
}
else {
return $true
}
}
)]
[Object]
$InputObject,

[Switch]
$Exact,

# Authentication credentials
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential = [System.Management.Automation.PSCredential]::Empty
)

# As we are not able to use proper type casting in the parameters, this is a workaround
# to extract the data from a JiraPS.Issue object
# This shall be removed once we have custom classes for the module
if ("JiraPS.User" -in $InputObject.PSObject.TypeNames) {
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] Using `$InputObject as object"
return $InputObject
}
else {
Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] Resolve User to object"
return (Get-JiraUser -UserName $InputObject -Exact:$Exact -Credential $Credential -ErrorAction Stop)
}
}
3 changes: 2 additions & 1 deletion JiraPS/Public/Add-JiraGroupMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ function Add-JiraGroupMember {

# Anyway, this builds a bunch of individual JSON strings with each username in its own Web
# request, which we'll loop through again in the Process block.
$users = Get-JiraUser -UserName $UserName -Credential $Credential
$users = Resolve-JiraUser -InputObject $UserName -Exact -Credential $Credential

foreach ($user in $users) {

if ($groupMembers -notcontains $user.Name) {
Expand Down
Loading

0 comments on commit ce55dcd

Please sign in to comment.