import random
import sys
import os
import jira.client
import json
import logging
import datetime
import base64
import requests
import urllib
import json
import smtplib
from jira.client import JIRA
from smtplib import SMTPException
from win32com.client import Dispatch
import win32com.client as win32
serverURL='http://ontrack-internal.mycompany.com'
query='project = SWDEV
jql='/rest/api/2/search?jql=%s' % urllib.parse.quote(query)
response=requests.get(serverURL+jql,verify=False,auth=("user","pass"))
#print (response.json())
#emailidset = set()
for issues in response.json()["issues"]:
tricat=(issues["fields"]["customfield_14307"])
print(tricat)
actually tricat variable gives the field value of jira ticket,but the json file has the value instead of field name.I need to get the name instead of numeric value.Please help?
Hi Rahul,
This will return a fields name. Using Python JIRA
jira = JIRA('server': "http://<url>",
basic_auth=("user", pass))
fields=jira.fields()
for field in fields:
print(field["name"])
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.