Add conditions in Bulk create workflow API payload

I am using the new Jira Bulk create workflow API. I want to add conditions in API payload but the documentation does not provide clear info. on this.
Condition I want to add:

{
  conditions: {
    conditions: [
      {
        type: "AllowOnlyReporter",
      },
      {
        type: "UserInGroupCondition",
        configuration: {
          group: "atlassian-addons-admin",
        },
      },
    ],
    operator: "OR",
  },
}

Can someone help how can I add condition in bulk create workflow API?

Hello @SagarGujarati

Your request example appears to have the wrong structure.

As per the documentation, conditions are child objects of transitions, which in turn are child objects of workflows, neither of which are defined in your request body. Next, within the lower conditions array object array, there are three possible sub-objects: id, parameter and ruleKey (required), none of which appear in your request:

Hi @sunnyape The sample payload I provided was as per old API which is deprecated.
I wanted to know what goes in the parameters, ruleKey etc. if I want to add the condition that I mentioned using the new create workflow API.

In that case, I suggest you have a look at the examples shown in the Get available workflow capabilities section of the documentation. It has a whole section for conditions and provides a number of examples of what response would be expected for different conditions, including example ruleKeys and all the values allowed for the parameters object for that rule type.

I haven’t used the new Bulk Create Workflows endpoint yet myself, so have no detailed knowledge or step-by-step instruction to pass on to you, so I can only suggest you start with the classic ‘Experiment yourself and learn as you go’ method.

For example, given that ruleKey is the only required object you must provide, why not just start with that only, then do some experiments by gradually adding some parameters and then looking at the resulting condition that is created in the workflow’s transition.

Have fun.