Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Project-specific custom variables

Hartmut Leister
Contributor
April 5, 2022

I want to read custom variables in regards to jira project via API / jira-python.

This project-specific configuration should then be used in some (external) scripts.

 

For now my best options seems to be to append some JSON (or similar) to the description, which could then be read and evaluated: 

>>> import re, json

# fake some description
>>> description = """some project
/* project variables */
config = { "foo": "bar" }"""

# read the data from description variable
>>> re.search( r"config = (\{.*\})", description)
<re.Match object; span=(37, 62), match='config = { "foo": "bar" }'>

# evaluate in python
>>> json.loads( re.search( r"config = (\{.*\})", description).groups()[0])
{'foo': 'bar'}

 

Do you see some better solution?

(Perhaps even one, that could be evaluated from Jira Automation?)

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community, loom ai, atlassian loom ai, loom, atlassian ai, record recaps of meetings, meeting recaps, loom recaps, share meeting recaps,

Loom’s guide to great meetings 📹

Join us to learn how your team can stay fully engaged in meetings without worrying about writing everything down. Dive into Loom's newest feature, Loom AI for meetings, which automatically takes notes and tracks action items.

Register today!
AUG Leaders

Atlassian Community Events