-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReqImport.py
More file actions
32 lines (22 loc) · 1.04 KB
/
ReqImport.py
File metadata and controls
32 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import valispace
import csv, json
deployment = input("Deployment Name:")
username = input("Username: ")
password = input("Password: ")
valispace = valispace.API(url="https://"+deployment+".valispace.com/", username=username, password=password)
## Add File path e.g. - Make sure you use /, not \, to divide folders
csvFilePath = ".../file.csv"
# Id of the specification the requirements should added to
specification_ID = 0
def import_req(csvFilePath, specification_ID):
with open(csvFilePath, encoding="utf8") as csvFile:
csvReader = csv.DictReader(csvFile)
for rows in csvReader:
req = {
"specification": specification_ID,
"identifier" : rows['ID'],
"title" : rows['Name'],
"text" : rows['Description']
}
requirementPosted = valispace.post('requirements/', req)
import_req(csvFilePath, specification_ID)