TFS4JIRA Self-Hosted - How to update credentials for all profiles present on the instance

This script should be run with TFS4JIRA Self 9.7 or higher.

This is a Python script that uses TFS4JIRA Self-Hosted API in order to update the synchronization user credentials for JIRA and for Azure DevOps/TFS.

PREREQUISITES:

  1. TFS4JIRA Self-Hosted 9.7 or higher

  2. The latest version of Python: https://www.python.org/downloads/

  3. Python IDE: PyCharm: https://www.jetbrains.com/pycharm/download/ (we will run the script in this editor)

  4. The script:

 

INITIAL SETUP IN SCRIPT :

  1. Set the API endpoint URL

    1. tfs4jira_url = "TFS4JIRA URL" This is your TFS4JIRA synchroniser URL

    2. jira_user = "" Email or login for synchronization user

    3. jira_password = "" Password or Personal Access Token in case of cloud instance

    4. tfs_user = "" Email or login for synchronization user

    5. tfs_password = "" Password or Personal Access Token in case of cloud instance

  2. Set the Bearer Token

    1. bearer_token = "" In order to obtain this token, please start TFS4JIRA and click the “manage profiles with API” link just below the blue ‘create profile’ button. This link will take you to Swagger. Click the ‘APIToken Page’ link to display the token

 

WHAT WILL IT DO?

  1. The script will get the list of all the profiles from the TFS4JIRA instance (in form of guids).

  2. Having a list of guids, script will for each guid, run API updating synchronisation user credentials (provided at the beginning of the script)

  3. The script will display error messages at any step in the PyCharm console, informing what went wrong