Edits history of script submission #3496 for ' Get workflow transition rule configurations (jira)'

  • nativets
    One script reply has been approved by the moderators
    Ap­pro­ved
    type Jira = {
      username: string;
      password: string;
      domain: string;
    };
    /**
     * Get workflow transition rule configurations
     * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect app.
     */
    export async function main(
      auth: Jira,
      Atlassian_Transfer_Id: string,
      body: {
        expand?: string;
        ruleIds: string[];
        workflowEntityId: string;
        [k: string]: unknown;
      }
    ) {
      const url = new URL(
        `https://${auth.domain}.atlassian.net/rest/atlassian-connect/1/migration/workflow/rule/search`
      );
    
      const response = await fetch(url, {
        method: "POST",
        headers: {
          "Atlassian-Transfer-Id": Atlassian_Transfer_Id,
          "Content-Type": "application/json",
          Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
        },
        body: JSON.stringify(body),
      });
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${response.status} ${text}`);
      }
      return await response.json();
    }
    

    Submitted by hugo697 396 days ago

  • nativets
    type Jira = {
      username: string;
      password: string;
      domain: string;
    };
    /**
     * Get workflow transition rule configurations
     * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect app.
     */
    export async function main(
      auth: Jira,
      Atlassian_Transfer_Id: string,
      body: {
        expand?: string;
        ruleIds: string[];
        workflowEntityId: string;
        [k: string]: unknown;
      }
    ) {
      const url = new URL(
        `https://${auth.domain}.atlassian.net/rest/atlassian-connect/1/migration/workflow/rule/search`
      );
    
      const response = await fetch(url, {
        method: "POST",
        headers: {
          "Atlassian-Transfer-Id": Atlassian_Transfer_Id,
          "Content-Type": "application/json",
          Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
        },
        body: JSON.stringify(body),
      });
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${response.status} ${text}`);
      }
      return await response.json();
    }
    

    Submitted by hugo697 823 days ago

  • nativets
    type Jira = {
      username: string;
      password: string;
      domain: string;
    };
    /**
     * Get workflow transition rule configurations
     * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect app.
     */
    export async function main(
      auth: Jira,
      Atlassian_Transfer_Id: string,
      body: {
        expand?: string;
        ruleIds:
          | [string]
          | [string, string]
          | [string, string, string]
          | [string, string, string, string]
          | [string, string, string, string, string]
          | [string, string, string, string, string, string]
          | [string, string, string, string, string, string, string]
          | [string, string, string, string, string, string, string, string]
          | [string, string, string, string, string, string, string, string, string]
          | [
              string,
              string,
              string,
              string,
              string,
              string,
              string,
              string,
              string,
              string
            ];
        workflowEntityId: string;
        [k: string]: unknown;
      }
    ) {
      const url = new URL(
        `https://${auth.domain}.atlassian.net/rest/atlassian-connect/1/migration/workflow/rule/search`
      );
    
      const response = await fetch(url, {
        method: "POST",
        headers: {
          "Atlassian-Transfer-Id": Atlassian_Transfer_Id,
          "Content-Type": "application/json",
          Authorization: "Basic " + btoa(`${auth.username}:${auth.password}`),
        },
        body: JSON.stringify(body),
      });
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`${response.status} ${text}`);
      }
      return await response.json();
    }
    

    Submitted by hugo697 948 days ago