Hi
My manager wanted to get a metric on how many rules each person created. Is it possible to take the metric from ONE Desktop Plan?
Hi
My manager wanted to get a metric on how many rules each person created. Is it possible to take the metric from ONE Desktop Plan?
Hi
thank you for your question. AFAIK, the author of the item is not a property that can be directly queried. However, you can query the history of the item and the latest record from the history will be the author. You can use for example this API query for one rule (but it can be used for all rules as well):
query GetEntityHistoryListing_rule($skip: Int, $size: Int, $gid: GID!) {
rule(gid: $gid) {
nodePath
history(skip: $skip, size: $size) {
edges {
node {
_from {
id
timestamp
author {
numericalIdentifier
... on Person {
username
firstName
lastName
email
userId
__typename
}
... on Service {
module
instanceId
__typename
}
__typename
}
__typename
}
_to {
id
timestamp
author {
numericalIdentifier
... on Person {
username
firstName
lastName
email
userId
__typename
}
... on Service {
module
instanceId
__typename
}
__typename
}
__typename
}
}
}
pageInfo {
hasNextPage
endCursor
__typename
}
totalCount
__typename
}
__typename
}
}
With variables:
{
"size": 10,
"gid": "36ed325c-0000-7000-0000-0000003afc15",
"skip": 0
}
The record with the lowest history id is the first occurance and the user associated with this change will be the original author. Once you have those records for all rules, you can group by the users and count the unique rules.
Another option is to use the Audit module, however, you would have to always obtain all the records, and customers usually use some retention period for the audit records.
I will also ask around internally if we have a better way to get to this information or at least use some ordering in the query and limiting to just that first history record, which could make the API easier, and I will post it here if I find anything.
Let me know if this helps or if you need more information or assistance.
Kind regards,
Anna
Hi
Could you please share the PLAN?
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.