Skip to content

Commit 4c6f20b

Browse files
Merge pull request #1610 from salesforcecli/wr/addOrgCreateAgent-User
Wr/add org create agent user @W-21532145@
2 parents 3266a3f + 9e454de commit 4c6f20b

File tree

10 files changed

+1011
-0
lines changed

10 files changed

+1011
-0
lines changed

command-snapshot.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
[
2+
{
3+
"alias": [],
4+
"command": "org:create:agent-user",
5+
"flagAliases": [],
6+
"flagChars": ["o"],
7+
"flags": ["api-version", "base-username", "first-name", "flags-dir", "json", "last-name", "target-org"],
8+
"plugin": "@salesforce/plugin-org"
9+
},
210
{
311
"alias": ["env:create:sandbox"],
412
"command": "org:create:sandbox",

messages/create_agent_user.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# summary
2+
3+
Create the default Salesforce user that is used to run an agent.
4+
5+
# description
6+
7+
You specify this user in the agent's Agent Script file using the "default_agent_user" parameter in the "config" block.
8+
9+
By default, this command:
10+
11+
- Generates a user called "Agent User" with a globally unique username. Use flags to change these default names.
12+
- Sets the user's email to the new username.
13+
- Assigns the user the "Einstein Agent User" profile.
14+
- Assigns the user these required permission sets: AgentforceServiceAgentBase, AgentforceServiceAgentUser,
15+
EinsteinGPTPromptTemplateUser
16+
- Checks that the user licenses required by the profile and permission sets are available in your org.
17+
18+
The generated user doesn't have a password. You can’t log into Salesforce using the agent user's username. Only
19+
Salesforce users with admin permissions can view or edit an agent user in Setup.
20+
21+
To assign additional permission sets or licenses after the user was created, use the "org assign permset" or "org assign
22+
permsetlicense" commands.
23+
24+
When the command completes, it displays a summary of what it did, including the new agent user's username and ID, the
25+
available licenses associated with the Einstein Agent User profile, and the profile and permission sets assigned to the
26+
agent user.
27+
28+
# examples
29+
30+
- Create an agent user with an auto-generated username; create the user in the org with alias "myorg":
31+
32+
<%= config.bin %> <%= command.id %> --target-org myorg
33+
34+
- Create an agent user by specifying a base username pattern; to make the username unique, the command appends a unique
35+
identifier:
36+
37+
<%= config.bin %> <%= command.id %> --base-username service-agent@corp.com --target-org myorg
38+
39+
- Create an agent user with an auto-generated username but the custom name "Service Agent"; create the user in your
40+
default org:
41+
42+
<%= config.bin %> <%= command.id %> --first-name Service --last-name Agent
43+
44+
# flags.target-org.summary
45+
46+
Username or alias of the target org where the agent user will be created.
47+
48+
# flags.base-username.summary
49+
50+
Base username pattern. A unique ID is appended to ensure global uniqueness of the usename.
51+
52+
# flags.base-username.description
53+
54+
Specify a base username in email format, such as "service-agent@corp.com". The command then appends a 12-character
55+
globally unique ID (GUID) to the name before the "@" sign, which ensures that the username is globally unique across all
56+
Salesforce orgs and sandboxes.
57+
58+
For example, if you specify "service-agent@corp.com", then the username might be "service-agent.a1b2c3d4e5f6@corp.com".
59+
60+
If not specified, the command auto-generates the username using this pattern: "agent.user.<GUID>@your-org-domain.com".
61+
62+
# flags.first-name.summary
63+
64+
First name for the agent user.
65+
66+
# flags.last-name.summary
67+
68+
Last name for the agent user.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/AgentUserCreateResponse",
4+
"definitions": {
5+
"AgentUserCreateResponse": {
6+
"type": "object",
7+
"properties": {
8+
"userId": {
9+
"type": "string"
10+
},
11+
"username": {
12+
"type": "string"
13+
},
14+
"profileId": {
15+
"type": "string"
16+
},
17+
"permissionSetsAssigned": {
18+
"type": "array",
19+
"items": {
20+
"type": "string"
21+
}
22+
},
23+
"permissionSetErrors": {
24+
"type": "array",
25+
"items": {
26+
"type": "object",
27+
"properties": {
28+
"permissionSet": {
29+
"type": "string"
30+
},
31+
"error": {
32+
"type": "string"
33+
}
34+
},
35+
"required": ["permissionSet", "error"],
36+
"additionalProperties": false
37+
}
38+
}
39+
},
40+
"required": ["userId", "username", "profileId", "permissionSetsAssigned", "permissionSetErrors"],
41+
"additionalProperties": false
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)