Can anyone share a workflow that extracts user list from Dynatrace? Ideally, we need the roles for each of the users as well in an excel spreadsheet that is emailed out.
Hey Vasan,
Emailing an Excel spreadsheet is not possible using the default Mailing action, as it only supports a title + description in plain string (text) format and does not allow attachments.
What we can do instead is generate a CSV-formatted string. You can then simply copy-paste this into Excel.
I already have a base implementation for this that fetches all users and formats them into CSV.
Required configuration in the JavaScript step
You will need to update the following part of the code:
await usersAndGroupsClient.getActiveUsersForOrganizationalLevel({
levelType: "account",
levelId: "ACCOUNTID",
partialString: "@DOMAIN",
});
Replace these values:
1. ACCOUNTID
You can retrieve this from:
- Open your account
- The ACCOUNT UUID is visible in the URL
- Copy the UUID and replace ACCOUNTID in the code
Example:
https://myaccount.dynatrace.com/account/home?account-uuid=xxxxx-xxxx-xxxx-xxxx-xxxx
→ Use the xxxxx-xxxx-xxxx-xxxx-xxxx part as ACCOUNTID
2. partialString: “@DOMAIN”
This is a required filter and must be at least 3 characters long.
You can use part of the email domain to filter results, for example:
- “@domain”
- “.eu”
- “.com”
mailing-all-users.workflow (1).json (2.12 KB)
Thanks, Dylan - will give it a whirl.