Skip to main content

API Automation with Python

 

SDET API Automation with Python.

1. Installation.

    Create a basic AUTH token for Jira.

         echo -n user@example.com:api_token_string | base64

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

We will perform get/Post operation on Jira issue.

Get issue

              GET /rest/api/3/issue/{issueIdOrKey}

   https://your-domain.atlassian.com/rest/api/3/issue/{issueIdOrKey}

      Using Basic Auth.

import requests

response=requests.get(
'https://qaclickcenter.atlassian.net/rest/api/3/issue/10001',
           
headers={'Authorization': 'Basic **********************'})
print(response.text)

 


{

    "expand""renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",

    "id""10001",

    "self""https://qaclickcenter.atlassian.net/rest/api/3/issue/10001",

    "key""QAC-2",

    "fields": {

        "statuscategorychangedate""2020-10-01T15:05:09.884+0530",

        "issuetype": {

            "self""https://qaclickcenter.atlassian.net/rest/api/3/issuetype/10004",

            "id""10004",

            "description""A problem or error.",

            "iconUrl""https://qaclickcenter.atlassian.net/secure/viewavatar?size=medium&avatarId=10303&avatarType=issuetype",

            "name""Bug",

            "subtask"false,

            "avatarId"10303

        },

 

 

   









Comments

Popular posts from this blog

Python Html Report

Html report using UnitTest and HtmlReporter            pip install html-reports import pytest import unittest import HtmlTestRunner from HtmlTestRunner import HTMLTestRunner import allure @allure.story ( 'Your Story here' ) @allure.feature ( 'Your Feature here' ) class CodeVlidation(unittest.TestCase):     @classmethod     def setUpClass ( cls ):         print ( 'Executed Before the all the method executed in class' )     @classmethod     def tearDownClass ( cls ):         print ( 'xecuted after the all the method executed in class' )     def setUp ( self ):         print ( "Setup the environment" )     def tearDown ( self ):         print ( "cle...