Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions examples/jira-add-components-to-all-projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@

components = ["Data Base", "HTML", "JavaScript"]

"""That example show how to create components on all existing projects"""
"""That example show how to create components on all existing projects, only skipping the one in a provided list"""

project_to_skip = [ "SI", "SA", "ETA"]

for i in jira.get_all_projects(included_archived=None):
for j in compo:
data = {"project": i["key"], "name":j}
jira.create_component(data)
print("{} - component created ".format(component.get('name')))
if i["key"] in project_to_skip :
print("Skipping project {} ".format(i["key"]))
else :
for j in components:
print("Creating in project {} ".format(i["key"]))
comp = {"project": i["key"], "name":j}
jira.create_component(comp)
print("{} - component created ".format(comp.get('name')))