Solved

Access user activity history through GraphQL

  • 14 September 2021
  • 1 reply
  • 325 views

Userlevel 2

It would be great is we could see which users moved a ticket into a phase via the GraphQL API.

At present we can see information regarding a phase movement via phases_history in the API but not who undertook this action. This would be extremely useful for auditing and training purposes. 

The activity history appears to present this information via the UI.

 

Thanks

icon

Best answer by genietim 14 September 2021, 19:21

View original

1 reply

Userlevel 7
Badge +12

If you use the network inspector, you get access to the “hidden”, private GraphQL API Pipefy internally uses. You can use that one too! At least if you are aware of the possibility of API changes, no support, etc.

The card activity (with detauls) can be queried like this:

 

await fetch("https://app-activities.pipefy.com/graphql", {
"credentials": "include",
"headers": {
"Accept": "*/*",
"content-type": "application/json",
},
"referrer": "https://app.pipefy.com/",
"body": "{\"operationName\":\"CardActivitiesQuery\",\"variables\":{\"orgUuid\":\"redacted\",\"pipeUuid\":\"redacted\",\"cardUuid\":\"redacted\",\"before\":null,\"pageSize\":30},\"query\":\"query CardActivitiesQuery($orgUuid: ID!, $pipeUuid: ID!, $cardUuid: ID!, $before: Cursor, $pageSize: Int) {
cardActivities(
orgUuid: $orgUuid
pipeUuid: $pipeUuid
cardUuid: $cardUuid
before: $before
pageSize: $pageSize
) {
nodes {
__typename
... on CardAssigneeCreate {
id
action
happenedAt
userName
assigneeName
__typename
}
... on CardAssigneeDestroy {
id
action
happenedAt
userName
assigneeName
__typename
}
... on CardLabelAdd {
id
action
happenedAt
userName
labelName
__typename
}
... on CardLabelDestroy {
id
action
happenedAt
userName
labelName
__typename
}
... on CardAttachmentCreate {
id
action
happenedAt
userName
fileName
link
cardUuid
__typename
}
... on CardAttachmentDestroy {
id
action
happenedAt
userName
fileName
__typename
}
... on CardCommentCreate {
id
action
happenedAt
commentContent
userName
__typename
}
... on CardCommentDestroy {
id
action
happenedAt
commentContent
userName
__typename
}
... on CardFieldValueUpdate {
id
action
happenedAt
beforeValue
afterValue
fieldType
fieldName
userName
via
__typename
}
... on CardMove {
id
action
happenedAt
oldPhaseTitle
newPhaseTitle
userName
__typename
}
... on CardTitleUpdate {
id
action
happenedAt
beforeValue
afterValue
userName
__typename
}
... on CardDone {
id
action
happenedAt
phaseTitle
__typename
}
... on CardOverdue {
id
action
happenedAt
phaseTitle
__typename
}
... on CardLate {
id
action
happenedAt
phaseTitle
__typename
}
... on CardExpired {
id
action
happenedAt
phaseTitle
__typename
}
... on CardChecklistDestroy {
id
action
happenedAt
userName
checklistTitle
__typename
}
... on CardChecklistCreate {
id
action
happenedAt
userName
checklistTitle
__typename
}
... on CardChildCreate {
id
action
happenedAt
userName
cardTitle
phaseTitle
pipeTitle
__typename
}
... on CardEmailSend {
id
action
happenedAt
userName
emailTitle
__typename
}
... on CardInboxEmailReceived {
id
action
happenedAt
cardTitle
__typename
}
... on CardInboxEmailSent {
id
action
happenedAt
cardTitle
userName
__typename
}
... on CardCreate {
id
action
happenedAt
via
userName
__typename
}
... on CardDestroy {
id
action
happenedAt
userName
__typename
}
... on PublicPhaseFormLink {
id
action
happenedAt
userName
cardTitle
phaseTitle
__typename
}
... on CardInboxEmailsRead {
id
action
happenedAt
cardUuid
userName
__typename
}
}
endCursor
hasNextPage
__typename
}
}
\"}",
"method": "POST",
"mode": "cors"
});

 

Reply