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

Bundling and Merging Tickets #34

Open
PsychoData opened this issue May 31, 2022 · 2 comments
Open

Bundling and Merging Tickets #34

PsychoData opened this issue May 31, 2022 · 2 comments

Comments

@PsychoData
Copy link

PsychoData commented May 31, 2022

Hi,

I am trying to Bundle/Un-bundle, and possibly Merge tickets automatically and I am not seeing a clear way to do this through here.

It looks like the Bundle-ing may be through this endpoint and the Child>Parent Merge operation through this endpoint

For the un-bundling (removing children) I am thinking that Update-CWMTicket might work? But perhaps not, since I can't find a field that directly lists the ChildTicket IDs

I did try this, in hopes it would be able to mimic the /service/tickets/{parentId}/attachChildren path and Add 143061 as a child to 141378

$UpdateParam = @{
    ID = 141378
    Operation = 'add'
    Path = 'attachChildren'
    Value = $("childTicketIDs=143061")
}
Update-CWMTicket @UpdateParam -verbose

But it was attempting to essentially Patch the Ticket 141378 with a node attachChildren to the value of childTicketIDs=143061
Probably roughly equivalent to this method? patchServiceTicketsById

playing with Debugging.... this seems to work, but Invoke-CWMNewMaster isn't exposed as public

$paramlist = @{ 
   childTicketIds=@(143061)
}
Invoke-CWMNewMaster -Arguments $paramlist -Endpoint '/service/tickets/141378/attachChildren'

Which works!
image

Or for invalid situations on Bundle

#Intentionally Trying to Merge a parent-with-children into a different ticket, which is invalid)

$paramlist = @{ 
    childTicketIds=@(141378)
} 
Invoke-CWMNewMaster -Arguments $paramlist -Endpoint '/service/tickets/143061/attachChildren'

it even gives helpful error messages
Success: False Message: Error absorbing Service Ticket #141368 -- This record cannot be absorbed because the supplied Parent record is a child of another Ticket.

Still trying to figure out removing children/un-bundling
Possibly set ParentID to empty/0 on Child tickets?

@samkebab
Copy link

ConnectWiseManageAPI.zip
Thanks Kevin for the help, I fixed up the module so the function works without having to go into debug mode, I have not looked into unbundling but do appreciate your insight.

@LMSJHaywood
Copy link
Contributor

@PsychoData, As far as I am aware, merging child tickets into a parent is a permanent action and cannot be undone once completed. I believe bundled tickets can be unbundled though, but I have not looked into how.

I've just submitted a pull request ( #49 ) which adds a New_CWMTicketChild function which can be used to either Bundle or Merge child ticket(s) into a parent ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants