openpyxl-redmine enquire¶
Note
Below etest-enquire is used in the examples. To perform real work replace etest by the acronym of the Redmine project procedure to be worked with (e.g. pmo, erd, crd…).
Warning
Good practice is to start each session with your working Redmine project by using the workflow_in_redmine command to certify that it’s the right Redmine project.
Overview¶
The enquire module provides additional looking into Redmine properties which are not specific only to workflows.
Authorization and execution is identical to that described in the workflow chapter and not repeated here.
Enquire commands¶
Use the -h request to view module help text. Currently it shows:
$ etest-enquire -h
usage: etest-enquire [-h] [--username USERNAME]
password {dump_project,dump_all_slims,
dump_anchor_slims, dump_request_slims,peek} ...
positional arguments:
password if --username then password, else user's API key
{dump_project,dump_all_slims,dump_anchor_slims,dump_request_slims,peek}
dump_project output the Redmine project info
dump_all_slims output all slims
dump_anchor_slims output anchor slims
dump_request_slims output request slims
peek output issue and slim content
file_slims save slims to json file
dump_membership output user accounts and their rights
optional arguments:
-h, --help show this help message and exit
--username USERNAME account with access rights to EuXFEL Redmine
Enquire command parameters¶
Use the sub-command -h to view sub-command help text, e.g.
$ etest-enquire $API_key peek -h
usage: etest-enquire password peek [-h] ticket#
positional arguments:
ticket# ticket ID, type <class 'int'>
optional arguments:
-h, --help show this help message and exit
A cut-and-paste from source code listing for all sub-commands shows:
sub_commands = {
'dump_project': {'help': 'output the Redmine project info',
'params': []},
'dump_all_slims': {'help': 'output all slims',
'params': []},
'dump_anchor_slims': {'help': 'output anchor slims',
'params': []},
'dump_request_slims': {'help': 'output request slims',
'params': []},
'peek': {'help': 'output issue and slim content',
'params': [('ticket#', int, 'ticket ID')]},
'file_slims': {'help': 'save slims to json file',
'params': [('filename', str, 'filename')]},
'dump_membership': {'help': 'output user accounts and their rights',
'params': []},
}
peek¶
Perhaps the most useful enquire function dumps the Redmine issue and its slim implementation - useful for debugging.
$ etest-enquire $API_key peek 87911
Caching Redmine Tasks - Wait!
Redmine Caching Finished - 151 Tasks
Peek issue id 87911
{'relations': None, 'time_entries': None, 'children': None,
'attachments': None, 'changesets': None, 'journals': None,
'watchers': None, 'id': 87911, 'project': {'id': 1330, 'name':
'PTC-ERD'}, 'tracker': {'id': 16, 'name': 'Elvis'}, 'status':
{'id': 8, 'name': 'Open'}, 'priority': {'id': 2, 'name': 'Normal'},
'author': {'id': 241, 'name': 'Christopher Youngman'}, 'subject':
'Add control support for "ACME PRODUCT" devices', 'description':
'', 'start_date': '2021-03-29', 'due_date': '2021-08-04',
'done_ratio': 0, 'custom_fields': [{'id': 43, 'name':
'Responsible Data Team', 'internal_name': None, 'field_format':
'value_tree'}], 'created_on': '2021-03-31T12:45:51Z', 'updated_on':
'2021-03-31T12:45:51Z'}
dict_keys(['relations', 'time_entries', 'children', 'attachments',
'changesets', 'journals', 'watchers', 'id', 'project', 'tracker',
'status', 'priority', 'author', 'subject', 'description', 'start_date',
'due_date', 'done_ratio', 'custom_fields', 'created_on', 'updated_on'])
Peek slim id 87911
{'id': 87911, 'project': 'PTC-ERD', 'tracker': 'Elvis', 'status': 'Open',
'priority': 'Normal', 'author': 'Christopher Youngman', 'subject':
'Add control support for "ACME PRODUCT" devices', 'description': '',
'start_date': '2021-03-29', 'due_date': '2021-08-04', 'done_ratio': 0,
'created_on': '2021-03-31T12:45:51Z', 'updated_on':
'2021-03-31T12:45:51Z', 'due_days': 121, 'updated_days': -5, 'children':
[87913, 87914, 87916, 87926, 87930, 87915, 87912]}
dict_keys(['id', 'project', 'tracker', 'status', 'priority', 'author',
'subject', 'description', 'start_date', 'due_date', 'done_ratio',
'created_on', 'updated_on', 'due_days', 'updated_days', 'children'])
dump_project¶
Dump project is not the best way to ensure that your in the correct Redmine project!
$ etest-enquire $API_key dump_project
Caching Redmine Tasks - Wait!
Redmine Caching Finished - 151 Tasks
project id: 1330 at https://in.xfel.eu/redmine
{'wiki_pages': None, 'memberships': None, 'issue_categories': None,
'time_entries': None, 'versions': None, 'news': None, 'issues': None,
'files': None, 'trackers': None, 'enabled_modules': None,
'time_entry_activities': None, 'id': 1330, 'name': 'PTC-ERD',
'identifier': 'ptc-erd', 'description': '', 'homepage': '',
'parent': {'id': 1328, 'name': 'Project Technical Coordination'},
'status': 1, 'author': {'id': 241, 'name': 'Christopher Youngman',
'easy_external_id': None}, 'sum_time_entries': 0.0,
'sum_estimated_hours': 0.0, 'created_on': '2021-02-01T15:54:56Z',
'updated_on': '2021-03-31T12:31:07Z',
'start_date': '2021-02-17', 'due_date': '2021-08-04'}
dump_all_slims¶
Dumps a short csv summary of all tasks in the Redmine project, which is useful for debugging. The descriptive header line starts ‘id,parent,’.
$ etest-enquire $API_key dump_all_slims
Caching Redmine Tasks - Wait!
Redmine Caching Finished - 151 Tasks
id,parent,children,tracker,status,priority,project,subject,assigned_to,
due_days,updated_days,next_step,row
83562,,,Elvis,Open,Normal,PTC-ERD,First task in ETEST,,,-47,,1
87351,87349,,Elvis,Open,Normal,PTC-ERD,Setup board of stakeholders
"SQS_Timepix3" device,,-13,-11,,2
...
88177,88176,,Elvis,Open,Normal,PTC-ERD,ERD for device "xyz_groups",
,121,-2,,149
88204,,[88206, 88207, 88209, 88219, 88223, 88208, 88205],Elvis,Open,
Normal,PTC-ERD,Add control support for "xyz_groups",,121,-2,,150
88205,88204,,Elvis,Open,Normal,PTC-ERD,ERD for device "xyz_groups",
,121,-2,,151
dump_anchor_slims¶
Similar to workflow module workflow_in_redmine, but dumps a short csv summary of the workflow anchor tasks. The descriptive header line starts ‘id,parent,’.
$ etest-enquire $API_key dump_anchor_slims
Caching Redmine Tasks - Wait!
Redmine Caching Finished - 151 Tasks
id,parent,children,tracker,status,priority,project,subject,assigned_to,
due_days,updated_days,next_step,row
87349,,[87351, 87352, 87354, 87364, 87368, 87353, 87350],Elvis,Open,
Normal,PTC-ERD,Add control support for "CTRL-EXAMPLE" devices,,114,
-11,,1
87865,,[87867, 87868, 87870, 87880, 87884, 87869, 87866],Elvis,Open,
Normal,PTC-ERD,Add control support for "CTRL-EXAMPLE" devices,,121,
-5,,2
...
88204,,[88206, 88207, 88209, 88219, 88223, 88208, 88205],Elvis,Open,
Normal,PTC-ERD,Add control support for "xyz_groups",,121,-2,,6
dump_request_slims¶
Not yet fully implemented. It should show request tickets waiting to processed into workflows. Currently it dumps a list of single childless tasks in the Redmine project folder.
$ etest-enquire $API_key dump_request_slims
Caching Redmine Tasks - Wait!
Redmine Caching Finished - 151 Tasks
id,parent,children,tracker,status,priority,project,subject,assigned_to,
due_days,updated_days,next_step,row
83562,,,Elvis,Open,Normal,PTC-ERD,First task in ETEST,,,-47,,1
file_slims¶
Saves all slims of the REdmine project to json file. These can be read into analyse_file.py for analysis.
dump_membership¶
Outputs user account names and their access rights to the Redmine project.