Skip to content

Commit 0b11674

Browse files
authored
Create jira-add-components-to-all-projects.py
New example with a loop over the project keys, to add the same components on each of the existing projects.
1 parent 2d2a070 commit 0b11674

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# coding=utf-8
2+
from atlassian import Jira
3+
4+
jira = Jira(
5+
url="http://localhost:8080/",
6+
username="jira-administrator",
7+
password="admin")
8+
9+
components = ["Data Base", "HTML", "JavaScript"]
10+
11+
"""That example show how to create components on all existing projects"""
12+
13+
for i in jira.get_all_projects(included_archived=None):
14+
for j in compo:
15+
data = {"project": i["key"], "name":j}
16+
jira.create_component(data)
17+
print("{} - component created ".format(component.get('name')))
18+

0 commit comments

Comments
 (0)