I've been trying to set self-service action input defaults on team, array, and string inputs based on properties of the current user or the action's triggering entity. I went through a lot of AI-suggested attempts, but nothing worked.
For instance, I have a self-service action that triggers a GitHub Actions workflow to create a git repo. There's an input to choose the team that should be added to the repo with admin privileges, but there's no way to default the team input to, say, the first team in the user's team list. I tried using
default
as shown below, but it doesn't do anything (I also tried
.user.teams[0].name
). It seems that
default
only supports a static string.
"github_admin_team": {
"type": "string",
"title": "GitHub Admin Team",
"icon": "DefaultProperty",
"format": "entity",
"blueprint": "_team",
"sort": {
"property": "$title",
"order": "ASC"
},
"default": {
"jqQuery": ".user.teamIdentifiers[0]"
}
},
I have another workflow to manage users on a team. I spent several hours going back and forth with the AI model trying many different strategies, but none could give me a pre-filled input with the list of current users that I could edit with a user dropdown. I ended up creating an add/remove toggle, and showing a different input for each mode.
For removing users from a team, the best I could do was create an unpopulated input and let the operator pick from an unsorted list of every user in the org to build a removal list.
"user_remove": {
"title": "Users to Remove",
"description": "The users to remove from the team",
"dependsOn": [
"team",
"action"
],
"visible": {
"jqQuery": ".form.team != null and .form.action == \"remove\""
},
"type": "array",
"items": {
"type": "string",
"format": "user"
}
}