File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
3
+ """
4
+ Date: 04/07/2020
5
+ Requirements:
6
+ 1. Define a Custom Field at the BOM Component Level from the Black Duck UI under Custom Fields Management.
7
+ 2. The field type needs to be "Text Area"
8
+
9
+ Script: Executing the script will write source paths of each component from a Project-Version to the defined Custom Field.
10
+ Executing the script again will simply overwrite the existing values with new ones. This is particularly useful if an end-user
11
+ is using REST APIs and would like to pull file paths.
12
+
13
+ """
14
+
3
15
import argparse
4
16
import logging
5
17
12
24
13
25
args = parser .parse_args ()
14
26
15
- custom_field_id = "4"
27
+ # Set the Custom Field Id
28
+ custom_field_id = ""
16
29
17
30
18
31
custom_headers = {'Accept' : 'application/vnd.blackducksoftware.bill-of-materials-6+json' }
23
36
project = hub .get_project_by_name (args .project_name )
24
37
version = hub .get_version_by_name (project , args .version )
25
38
39
+ # Custom Field Id Check
40
+ if custom_field_id == "" :
41
+ print ("Set the custom_field_id variable above with the correct Id and try executing the script again." )
42
+ exit ()
43
+
26
44
# Get all BOM Components
27
45
bom_components = hub .get_version_components (version )
28
46
You can’t perform that action at this time.
0 commit comments