---
agent_capabilities:
- Structured Data Analyzer
availability: IDEA
description: A plugin that groups incidents by assignment_group over the past year
and calculates the month-over-month growth rate.
name: Look up Incident Growth by Assignment Group
purple_chat_link: https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EWhat+assignment+groups+are+showing+the+most+growth+in+incidents+in+the+past+year%3F+I+need+to+do+some+capacity+planning.%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ECertainly.+I+will+analyze+incidents+from+ServiceNow+over+the+past+year+to+identify+which+assignment+groups+have+the+highest+month-over-month+growth+rate.%3C%2Fp%3E%22%7D%2C%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22Fetching+incidents+from+the+past+year+from+ServiceNow%22%2C%22status%22%3A%22success%22%7D%2C%7B%22richText%22%3A%22Grouping+incidents+by+assignment+group+and+month%22%2C%22status%22%3A%22success%22%7D%2C%7B%22richText%22%3A%22Running+Structured+Data+Analyzer%22%2C%22status%22%3A%22pending%22%7D%5D%7D%2C%7B%22apiBlock%22%3A%7B%22code%22%3A%22%23+Fetch+all+incidents+from+the+last+12+months+from+ServiceNow%5Cnincidents+%3D+servicenow.get_incidents%28timeframe%3D%27last_12_months%27%29%5Cn%5Cn%23+Group+incidents+by+assignment+group+and+month%5Cnmonthly_counts+%3D+%7B%7D%5Cnfor+incident+in+incidents%3A%5Cn++++group+%3D+incident.assignment_group%5Cn++++month+%3D+incident.created_at.strftime%28%27%25Y-%25m%27%29%5Cn++++if+group+not+in+monthly_counts%3A%5Cn++++++++monthly_counts%5Bgroup%5D+%3D+%7B%7D%5Cn++++monthly_counts%5Bgroup%5D%5Bmonth%5D+%3D+monthly_counts%5Bgroup%5D.get%28month%2C+0%29+%2B+1%5Cn%5Cn%23+Calculate+month-over-month+growth+for+each+group%5Cngrowth_rates+%3D+%7B%7D%5Cnfor+group%2C+counts+in+monthly_counts.items%28%29%3A%5Cn++++sorted_months+%3D+sorted%28counts.keys%28%29%29%5Cn++++total_growth+%3D+0%5Cn++++num_periods+%3D+0%5Cn++++for+i+in+range%281%2C+len%28sorted_months%29%29%3A%5Cn++++++++prev_month+%3D+sorted_months%5Bi-1%5D%5Cn++++++++curr_month+%3D+sorted_months%5Bi%5D%5Cn++++++++if+counts%5Bprev_month%5D+%3E+0%3A%5Cn++++++++++++growth+%3D+%28counts%5Bcurr_month%5D+-+counts%5Bprev_month%5D%29+%2F+counts%5Bprev_month%5D%5Cn++++++++++++total_growth+%2B%3D+growth%5Cn++++++++++++num_periods+%2B%3D+1%5Cn++++if+num_periods+%3E+0%3A%5Cn++++++++average_growth+%3D+%28total_growth+%2F+num_periods%29+*+100%5Cn++++++++growth_rates%5Bgroup%5D+%3D+average_growth%5Cn%5Cn%23+Final+result+is+a+dictionary+mapping+assignment+groups+to+their+average+monthly+growth+rate%5Cn%23+Example%3A+%7B%27Network+Support%27%3A+15.2%2C+%27Database+Admins%27%3A+12.5%7D%22%2C%22caption%22%3A%22The+Structured+Data+Analyzer+dynamically+generates+Python+code+based+on+the+User%27s+Statement%22%2C%22connectorName%22%3A%22moveworks%22%2C%22title%22%3A%22Structured+Data+Analyzer%22%7D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EHere+are+the+assignment+groups+with+the+highest+month-over-month+growth+in+incidents+over+the+past+year%3A%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3ENetwork+Support%3A%3C%2Fb%3E+15.2%25%3C%2Fli%3E%3Cli%3E%3Cb%3EDatabase+Admins%3A%3C%2Fb%3E+12.5%25%3C%2Fli%3E%3Cli%3E%3Cb%3EHelp+Desk+Tier+2%3A%3C%2Fb%3E+8.1%25%3C%2Fli%3E%3Cli%3E%3Cb%3EApplication+Support%3A%3C%2Fb%3E+5.5%25%3C%2Fli%3E%3C%2Ful%3E%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EThe+Network+Support+group+is+showing+the+most+significant+growth.%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Incidents%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%2C%22showFeedbackTray%22%3Afalse%7D%5D%2C%22assistantConfig%22%3A%7B%22userName%22%3A%22Moveworks%22%2C%22initials%22%3A%22U%22%2C%22providedIcon%22%3A%22silhoutte%22%7D%7D
solution_tags:
- IT
systems:
- servicenow
---