I share here how I have improved my Jira PowerBI Template to automatically rename the field columns by the real field names instead of their Ids.
Problem description
My previous solution was only working if you used specific columns for your imported filter.
It shall be easy to rename automatically the field columns in the Data from Field Id to Field (real) name.
Improvement
Now the solution will get the mapping field Id <-> field name for renaming using the REST API command GET FIELDS / rest/ api/ 2/ field
Extracting List Id, Name for passing to Table.RenameColumns using Table.ToRows
Using Table.RenameColumns with MissingField.Ignore
// extracting field info
restUrl = JiraRootUrl&"/rest/api/2/field",
FieldsList= Json.Document(Web.Contents(restUrl)),
#"Converted to Table" = Table.FromList(FieldsList, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
FieldsIdNameTable = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "name"}, {"id", "name"}),
Issues = Table.RenameColumns(IssuesRaw,Table.ToRows(FieldsIdNameTable),MissingField.Ignore),
Reference
No comments:
Post a Comment