Provisioning users and applications from a Jira action

1Password SaaS Management supports running workflows based on triggers in other applications. We suggest starting off by looking at a simple use case about running SaaS Manager workflows from Jira automations.

This article covers additional features including:

  • Handling more complex array field types in Jira.
  • Creating and provisioning a new person (identity) in the SaaS Management workflow.
  • Conditionally provisioning applications based on what was selected in Jira.

Create a multi-select custom field in Jira

  1. Go to Settings (cog icon) > Issues > Custom fields.

  2. Click Create custom field.

  3. Choose Select List (multiple choices) and click Next:

    Jira Select a Field Type dialog with Select List multiple choices selected

  4. Add a Name for the field, optionally a description and then Add a number of application names that you might want to provision for a user.

    Jira Configure Checkboxes Field dialog for an Applications field with application options

  5. When you’re done click Create.

  6. You can ignore the Associate field Applications to screens step for now and just click Update

    Jira screen association page for the Applications custom field with Update highlighted

  7. Go to Project Settings > Issue types and search for the new custom Applications field

    Jira project Issue types settings with the Applications field selected

  8. Also add a Short text field called Work email.

Create a test Issue in your Jira project

  1. You can create a new Issue in various ways in Jira, but one approach is to create a form and add the new fields to this:

    Jira employee onboarding form with work email and selected applications fields

  2. Open up the new issue. You will see the Work email and Applications fields.

    On the right-hand panel click Actions and then choose Create automation.

    Jira employee issue showing work email and applications with Create automation selected

Create the automation in Jira

  1. The process for creating the automation is very similar to that outlined in the first article about running SaaS Manager workflows from Jira automations.

  2. Use the following Custom data for the Jira Web request body

    {
      "issueKey": {{issue.key.asJsonString}},
      "issueStatusName": {{issue.status.name.asJsonString}},
      "issueSummary": {{issue.summary.asJsonString}},
      "issueTypeName": {{issue.issueType.name.asJsonString}},
      "reporterEmail": "{{reporter.emailAddress.asString}}",
      "work_email": {{issue.Work email.asJsonString}},
      "joiner_first_name": {{issue.summary.split(" ").first.asJsonString}},
      "joiner_last_name": {{issue.summary.split(" ").last.asJsonString}},
      "applications": {{issue.Applications.value.asJsonStringArray}}
    }
    

    Notice the special syntax for returning the multi-select applications field (.value.asJsonStringArray).

    Also, the syntax for reporterEmail is slightly different. This is a work-around because if you use the Validate your web request option in Jira then it posts an empty value. This does however work correctly if you trigger an automation from an issue directly.

  3. Create an Applications field in SaaS Management. The options should match the options you entered into Jira. Make sure Allow multiple value selection is checked.

    SaaS Manager Create field dialog with an Applications option field allowing multiple selections

  4. Create some more matching text fields over in your SaaS Management workflow:

    • Joiner first name
    • Joiner last name
    • Work email
  5. Now try testing the webhook from SaaS Management by using the Validate your web request configuration in Jira.

  6. If everything is looking good then swap the URL in Jira for the non-test URL in SaaS Management:

    Jira automation Send web request action with the SaaS Manager webhook URL

  7. Save and Publish your Jira automation.

Build your SaaS Management workflow

  1. Firstly we will add a Create person action to our workflow. This is needed because the default context for the workflow is ‘None’ (since the person doesn’t exist yet, so SaaS Management can’t match).

    By creating a person we are then positioned to create accounts for them in other systems, for example Google Workspace.

    SaaS Manager workflow Create person action with first name, last name, and email fields

  2. With that in place we can add a step for creating an account in our identity provider, in this case Google Workspace.

    SaaS Manager Google Workspace Provision account action with username and password settings

Add provisioning steps

To deal with the different application options, you need to:

  • Add a field condition (to check whether the application was selected).
  • Add the condition to a new group (so that once the condition and potential actions are performed, processing returns to the main path of the workflow).
  • Add a provisioning step if the condition is met.
  1. Add a Field condition to your workflow.

  2. Check for the name of an application.

  3. Add the condition to a new group:

    SaaS Manager workflow field condition for Application is Zoom

  4. Give the group the same name as the application (for consistency).

  5. Open the new group

    SaaS Manager Zoom field condition with the Then branch selected

  6. Add a provisioning action for the application:

    SaaS Manager workflow branch where Application is Zoom leads to a Provision account action

  7. Repeat the above for each application you want, configuring each provisioning action as required.

Test the automation and workflow

Make sure your SaaS Management workflow is enabled. Webhooks only work when the workflow is enabled.

Then run the Onboard employee automation in Jira:

Jira employee issue Actions menu with the Onboard employee automation action

The workflow should then run in SaaS Management.



Published: