Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-FSRequesterGroupMember.ps1 returns a list of Requester Groups and not a list of Group Members #15

Open
CoryInIT opened this issue Dec 18, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@CoryInIT
Copy link

When calling Get-FSRequesterGroupMember it is returning a list of Requester Groups, and not the membership in the group specified in the function parameter i.e. Get-FSRequesterGroupMember -id '2000009XXXX' -Verbose

Expected Behavior

The function should return an object containing the list of members of the group specified in the request.

Current Behavior

The function returns an object which contains the list of requester groups.

Possible Solution

Verify that the appropriate URL is being constructed in the module Get-FreshServiceRequesterGroupMember.ps1 There appears to be inconsistency in lines 72 & 73 as to which variable is referenced. (<- Don't know that this is the cause, but I just noticed the inconsistency, IANAP).

Verbose output does not show the requester group ID nor the appended "/members" url path required by the API:
VERBOSE: Invoke-FreshworksRestMethod - Initiating REST API call to https://company.freshservice.com/api/v2/requester_groups?page=1&per_page=100
VERBOSE: Invoke-FreshworksRestMethod - Uri: https://company.freshservice.com/api/v2/requester_groups?page=1&per_page=100

I would expect the URI to contain:
https://company.freshservice.com/api/v2/requester_groups/2000009XXXX/members?page=1&per_page=100

Steps to Reproduce (for bugs)

  1. Create a Freshservice API Connection using "New-FreshServiceConnection"
  2. Connect to the connection using "Connect-Freshservice"
  3. Make the function call using a known group ID, "Get-FSRequesterGroupMember -id '2000009XXXX' -Verbose"
  4. Observe the output, a list of all requester groups.

Context

I'm trying to get a current list of the requester group members to synchronize them with an Active Directory group.

Your Environment

Module version: 0.1.6
Powershell version: PSVersion 5.1.19041.3031
Windows 10.0.19044

@rasimmers rasimmers self-assigned this Dec 19, 2023
@rasimmers rasimmers added the bug Something isn't working label Dec 19, 2023
@rasimmers
Copy link
Contributor

Confirmed this is a bug. There is an if statement that was failing and /members were not appended. Updated If statement for next release.

@dkpham81
Copy link

Get-FreshServiceRequesterGroupMember.ps1
Line 72
Should be:
if ($id) {
instead of
if ($requester_group_id) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants