...
TFS4JIRA Self-Hosted 9.7 or higher
The latest version of Python: https://www.python.org/downloads/
Python IDE: PyCharm: https://www.jetbrains.com/pycharm/download/ (we will run the script in this editor)
The script:
View file | ||
---|---|---|
|
...
INITIAL SETUP IN SCRIPT :
Set the API endpoint URL
ADO credentials
org_url = '<https://dev.azure.com/<ORG>/'> - Azure DevOps (ADO) organization URL
pat = 'xemhf6ez4i7svvho' - Personal access token (replace with your own token)
project = 'xyz1234' - Project name in Azure DevOps (ADO)
JiraFieldInADO = 'Custom.T4J_IssueKey' - Custom A custom field in ADO used to store JIRA Issue Key
JIRA credentials
JiraUrl = 'http://52.24.97.338:8080' - Set JIRA URL
auth = ('<username>', '<password>') - Set the authentication credentials - username and password
ADOfieldInJira = 'customfield_10112' - Custom A custom field in Jira used to store work Item ID
OPTIONAL - the query used to fetch ADO work items can be modified to only fetch relevant work items (for example, with specific Area Path)
Code Block language sql wiql_query = f'SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = "{project}" and [{JiraFieldInADO}] <>""'
...
The script will get the list of all the work item IDs and saved Jira keys from the new ADO instance.
Having the list of IDs, the script will connect to each Jira issue (using the obtained key) and update ADOfieldInJira with a new work item ID.
Script The script will display error messages at any step in the PyCharm console, informing what went wrong
Script The script will also save a log file with the following format (each run, one log file):
workitem_update_script_log_<date>-<time>The log file is saved in the same location as the script file and is immediately visible in PyCharm’s project files explorer