Last active
December 24, 2023 18:45
-
-
Save tdalon/254a1daa1990d22aa55b82dae7a03be3 to your computer and use it in GitHub Desktop.
How to Get Jira Issue Field Value in PowerQuery M
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(FieldName as text) as text => | |
let | |
Source = Json.Document(Web.Contents(JiraRootUrl & "/rest/api/latest/field")), | |
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), | |
#"ExpandedTable" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "name"}, {"id", "name"}), | |
Record = Table.First(Table.SelectRows(ExpandedTable, each ([name] = FieldName))), | |
FieldId = Record.Field(Record,"id") | |
in | |
FieldId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(IssueKey as text, FieldName as text) => | |
let | |
FieldId = JiraFieldName2Id(FieldName), | |
Source = Json.Document(Web.Contents(JiraRootUrl & "/rest/api/2/issue/" & IssueKey & "?fields=" & FieldId)), | |
fields = Source[fields], | |
Field = Record.Field(fields,FieldId), | |
FieldValue = if Field = null then null else Record.Field(Field,"value") | |
in | |
FieldValue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See explanation in blog post https://tdalon.blogspot.com/2022/06/jira-powerquery-get-field-value.html