/
Import using Swagger

Import using Swagger

Currently, you need to execute this endpoint twice (6/c): /repository/scenario/import

We are working on the scenario import to only have to do it once in the same way as how you need to execute only once every other endpoint also and not twice.

 

  1. For the prerequisites, please read the parent page first: https://jira-testifi.atlassian.net/wiki/spaces/CTF/pages/8850604037/Import+from+repository+to+CAST+GUI

  2. Visit the Swagger page

  3. In the “user-controller” section click on the “/login“ and click on the “Try it out“ button.
    Depending on CAST:GUI uses the /login endpoint or /loginWithSSO endpoint, you have to get/fill out the payload differently:

    1. /login:

      1. at the Authorization click on the tick right before the “Send empty value“

      2. email: your email address/username - what you access to Jira with

      3. jiraApiToken: your generated Jira token Log in and Set Credentials

      4. jiraUrl: the URL for the Jira

      5. token: this is true by default, but you should overwrite it to false

      6. if you are using cloud - xrayClientId and xrayClientSecret: your xrayClientId and xrayClientSecret
        if you are using server - xrayClientId and xrayClientSecret: can stay on the default value as “string“

      7. everything else can be “string“

      8. click on the “Try it out“ button

    2. /loginWithSSO:
      since WEB-EAM Next is in it’s place:

      1. navigate to the CAST:GUI

      2. navigate to the Credentials from the main menu on the home screen

      3. get the browser’s inspector and click on the Network tab

      4. click on the Save changes button

      5. find the /loginWIthSSO endpoint and copy the payload from it

      6. navigate back to the swagger page and insert the payload into the /loginWithSSO endpoint’s payload

      7. click on the “Try it out“ button

  4. If the response is 200, copy the jwt’s value from the response
    important: jwt token is valid only once doing the import. If you want to check the import on the UI, and then continue the import then you need to generate a new jwt token for the “Authorization”

  5. Click on the Authorize button

    image-20250307-143222.png

    to the Authorization first type the word “Bearer “ (with the space) and then insert the copied jwt token’s value - (Bearer with space and the jwt token), then click on Authorize button
    important: if the JWT token expires or becomes invalid, e.g. due to a UI action, the user will have to repeat steps 3-4-5 to be able to start a new request

    image-20250307-143414.png
  6. Scroll up to the “git-controller“ section and open it

  7. Repeat the steps in this order for all the 4 endpoints from the 7th step:

    1. /repository/sui-page/import

    2. /repository/building-block/import

    3. /repository/scenario/import (because of the reason mentioned above, currently you need to execute this endpoint twice)

    4. /repository/data/import

  8. Select the endpoint that you want to Execute and click on the “Try it out“ button

    1. fill up the json (explanation below)

    2. click on the “Execute” button

    3. if the response is 200 then the import is done

Explanation for the json at the gitImport:

  • branch: the name of the branch from which branch you’ll import (if the branch name is “feature/branch1” then the branch name will be “feature/branch1” and not just “branch1”)

  • password: this is the token that you generated for the repository Token generation for the repository

  • repoURL: when you want to clone the repo with HTTPS you can find this URL there and it should end with “.git”

  • skipSSLVerify: by default this is true, you don’t need to change on this

  • username: username for the repository (on BMW this is the QX)

  • projectKey: this is the project’s id https://jira-testifi.atlassian.net/wiki/spaces/CTF/pages/8983150593/How+to+find+project+s+id

Related content