AtlassianPS / JiraPS

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

Comments are added with non default secuirty. #172

Closed 123dev closed 6 years ago

123dev commented 6 years ago

Expected Behavior

We use Add-JiraIssueComment -Issue $jiraID -Comment $comment -Credential $cred` to add comments to tickets, We're expecting the comments to be added in default security context All Users However they are being added with some security context that is non-default (we have many)

See attachment. image

Steps to Reproduce (for bugs)

  1. Make sure you have multiple Security Levels defined in Jira
  2. Add-JiraIssueComment -Issue $jiraID -Comment $comment -Credential $cred`

Environment

Get-Module JiraPS -ListAvailable | select version

Version
-------
2.2.0.141

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.1532
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.1532
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
lipkau commented 6 years ago

Thanks for reporting this. Indeed I also find it weird that the default value for the visibility is Developers: https://github.com/AtlassianPS/JiraPS/blob/master/JiraPS/Public/Add-JiraIssueComment.ps1#L48

I agree with changing the default to All Users.

Do you have more visibility roles than the 3 in the code?

123dev commented 6 years ago

Thanks Oliver.

Yes, we have more, the way Jira allows us to select is: All Users, then lists all Project Roles and then lists all Groups (see pic) image

I guess the best way would be for those options to be dynamically loaded, but I understand that's must bigger work. I'd be happy with All Users being selected by default, and perhaps an option to specify different security level if one chooses to (not necessary for our use case, All users choice is good enough)

123dev commented 6 years ago

I didn't realize that this option was available. so I just added this to my command -VisibleRole 'All Users'

This should do it for us. But the default eventually changing to 'All Users' would be good idea.

Thanks

lipkau commented 6 years ago

ToDo

Change default

lipkau commented 6 years ago

Changing the parameter is a breaking change This is continue by: #174