Skip to content

Bundling and Merging Tickets #34

@PsychoData

Description

@PsychoData

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions