Update Zammad Roles to Default
detail.loadingPreview
Automate the process of updating all Zammad user roles to a predefined default set and optionally export current roles.
About This Workflow
This n8n workflow is designed to manage user roles within Zammad. It fetches all existing users and roles from Zammad, allows for selective exclusion of users, and updates the roles of active users to a specified default set. Additionally, it can export a list of all available Zammad roles to an Excel file.
Key Features
- Automated Role Updates: Set a default role for all active Zammad users.
- User Exclusion: Define specific user IDs to exclude from role updates.
- Role Fetching: Retrieve all available roles from Zammad.
- Excel Export: Generate an Excel file containing all Zammad roles for easy review.
- Configurable: Easily set Zammad API credentials, base URL, default roles, and excluded users via the 'Basic Variables' node.
How To Use
-
Configure Basic Variables:
- Update the
zammad_base_urlandzammad_api_keyin theBasic Variablesnode with your Zammad instance details and API key. - Set the
default_rolesto an array of role IDs (e.g.,[2, 3]) that you want to assign to users. - (Optional) Populate
exclude_zammad_users_by_idwith an array of user IDs that should not have their roles updated.
- Update the
-
Trigger the Workflow:
- Click the 'Test workflow' button on the
When clicking ‘Test workflow’node.
- Click the 'Test workflow' button on the
-
Workflow Execution:
- The workflow will first fetch all roles using the
Get all Rolesnode. - It then fetches all users via the
Get all Usersnode. - For each user, the
Ifnode checks if the user should be excluded or if they are active. - If the conditions are met (user is active and not excluded), the
Update Users to default Role(s)node will update their roles using a PUT request. - Simultaneously, the
Zammad Univeral Role Objectnode processes fetched roles. TheFilter Roles if needednode then passes these roles toConvert to Excel Rolesto generate theZammad_Roles.xlsxfile.
- The workflow will first fetch all roles using the
Node Explanations:
When clicking ‘Test workflow’: Manual trigger to start the workflow.Basic Variables: Centralizes configuration for Zammad URL, API key, default roles, and excluded user IDs.Get all Roles: Retrieves all available roles from the Zammad API.Zammad Univeral Role Object: Structures the data for each fetched role.Filter Roles if needed: A conditional node that currently has minimal filtering logic but could be expanded.Convert to Excel Roles: Converts the processed role data into an Excel (.xlsx) file.Get all Users: Fetches all user data from Zammad.Zammad Univeral User Object: Restructures user data for easier processing.If: Filters users based on exclusion lists and their active status.Update Users to default Role(s): Sends a PUT request to update therole_idsof qualifying users.
Apps Used
Workflow JSON
{
"id": "3e24eb11-e813-4f3d-ad93-99b1ed8aafed",
"name": "Update Zammad Roles to Default",
"nodes": 18,
"category": "User Management",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 3e24eb11-e813...
About the Author
N8N_Community_Pick
Curator
Hand-picked high quality workflows from the global community.
Statistics
Related Workflows
Discover more workflows you might like
Automate User Invitation to n8n from Google Sheets
Automatically invite users to your n8n instance from a Google Sheet.