cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

Por favor, ayude a limpiar el código del conector Jira

¡Hola a todos!

Tenemos Jira Service Management Cloud y Power BI Desktop con un conector. Actualmente necesito agregar una columna más con Reaction SLA por hora. El problema es: los datos están en formato JSON, por lo que duplicar la columna con los mismos datos primarios archivados conduce a un error: se puede acceder a los datos a través del Editor, pero no es avalable desde la aplicación.

Feedback Type:
Frown (Error)

Error Message:
An error occurred while rendering the report.

Stack Trace:
Microsoft.PowerBI.Client.Windows.JavaScriptException
Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: prop in $ctrl.viewModel.properties | filter:$ctrl.filterProperties, Duplicate key: object:261, Duplicate value: {"hasCheckedChildren":false,"contract":{"displayName":"Resolution breach Hour","name":"Resolution breach Hour","type":{"underlyingType":260,"category":null},"column":{"defaultAggregate":2,"variations":[]},"kind":0,"format":"0","canDelete":true},"schema":{"entities":[{"name":"Jira-Issues","displayName":"Jira-Issues","visibility":0,"properties":


Tengo poco conocimiento en M así que no puedo entender cómo arreglar el código. Por favor, ayúdame a limpiar el código:

dejar
    Problemas = dejar
    Problemas = dejar
    Fuente = JiraData,
    #"Campos expandidos" = Table.ExpandRecordColumn(Source, "fields", Text.Split(FieldsToGet,",")),
    #"Asignado expandido" = Table.ExpandRecordColumn(#"Campos expandidos", "cesionario", {"displayName"}, {"Assignee"}),
    #"Reportero expandido" = Table.ExpandRecordColumn(#"Asignado expandido", "reportero", {"displayName"}, {"Reporter"}),
    #"Reemplazar cesionario nulo" = Table.TransformColumns(#"Expanded reporter", {"Assignee", cada uno si _ es null y luego "Unssigned" else _}),
    #"Proyecto expandido" = Table.ExpandRecordColumn(#"Reemplazar cesionario nulo", "project", {"key", "name"}, {"Project", "Project Name"}),
    #"Transform project name" = Table.ReplaceValue(#"Expanded project", cada [Nombre del proyecto], cada [Nombre del proyecto] & " (" y [Project] & ")", Replacer.ReplaceText, {"Project Name"}),
    #"Prioridad expandida" = Table.ExpandRecordColumn(#"Transform project name", "priority", {"name", "id", "iconUrl"}, {"Priority", "Priority Id", "Priority Icon URL"}),
    #"Tipo de problema expandido" = Table.ExpandRecordColumn(#"Prioridad expandida", "issuetype", {"name", "subtask"}, {"Issue Type", "Is Subtask"}),
    #"Estado expandido" = Table.ExpandRecordColumn(#"Tipo de problema expandido", "status", {"name", "id", "iconUrl"}, {"Status", "Status Id", "Status Icon URL"}),
    #"Resolución expandida" = Table.ExpandRecordColumn(#"Estado expandido", "resolución", {"name"}, {"Resolution"}),
    #"Componentes expandidos" = Table.ExpandListColumn(#"Resolución expandida", "componentes"),
    #"Componentes expandidos1" = Table.ExpandRecordColumn(#"Componentes expandidos", "components", {"name"}, {"Components"}),
    #"Reemplazar resolución nula" = Table.TransformColumns(#"Expanded components1", {"Resolution", cada uno if _ es null entonces "Unresolved" else _}),
    #"Tipo cambiado" = Table.TransformColumnTypes(#"Replace null resolution",{{"created", type datetimezone}, {"updated", type datetimezone}, {"resolutiondate", type datetimezone}, {"id", Int64.Type}, {"Priority Id", Int64.Type}}),
    #"Add hour created" = Table.AddColumn(#"Tipo cambiado", "Hora creada", cada Time.Hour([creado]), Int64.Type),
    #"Agregar fecha creada" = Table.AddColumn(#"Add hour created", "Date Created", cada Date.From([created]), type date),
    #"Add week created" = Table.AddColumn(#"Add date created", "Week Created", cada Date.EndOfWeek([Fecha creada]), fecha de tipo),
    #"Agregar fecha actualizada" = Table.AddColumn(#"Agregar semana creada", "Fecha actualizada", cada fecha.From([updated]), fecha de tipo),
    #"Agregar semana actualizada" = Table.AddColumn(#"Agregar fecha actualizada", "Semana actualizada", cada Date.EndOfWeek([Fecha actualizada]), fecha de tipo),
    #"Agregar fecha resuelta" = Table.AddColumn(#"Agregar semana actualizada", "Fecha resuelta", cada fecha.From([resolutiondate]), fecha de tipo),
    #"Agregar resolución de semana" = Table.AddColumn(#"Agregar fecha resuelta", "Semana resuelta", cada Fecha.EndOfWeek([Fecha resuelta]), fecha de tipo),
    #"Agregar se resuelve" = Table.AddColumn(#"Agregar resolución de semana", "Se resuelve", cada uno si [Fecha resuelta] <> null o List.Contains({"Cancelled","Closed","Done"}, [Status]) y, a continuación, 1 else 0, Int32.Type),
    #"Agregar estado de resolución" = Table.AddColumn(#"Add Is Resolved", "Resolution Status", cada uno si [Se resuelve] = 1 entonces "Resuelto" else "Unresolved", texto de tipo),
    #"Columnas eliminadas" = Table.RemoveColumns(#"Add Resolution Status", {"expand","Meta", "Timestamp","created","updated","resolutiondate"}),
    #"Columnas renombradas" = Table.RenameColumns(#"Columnas eliminadas",{{"id", "Id de problema"}, {"key", "Issue Key"}, {"self", "Issue URL"}, {"summary", "Summary"}}),
    #"Url de problema de transformación" = Table.ReplaceValue(#"Renamed Columns", cada [URL de emisión], cada JiraURL & "/browse/" y [Clave de problema], Replacer.ReplaceText, {"Dirección URL del problema"})
en
    #"Transformar URL de problema",
    #"customfield_10103 expandido" = Table.ExpandRecordColumn(Issues, "customfield_10103", {"value"}, {"MCS Service"}),
    #"Columnas renombradas" = Table.RenameColumns(#"Expanded customfield_10103",{{"customfield_10101", "Resource ID"}, {"customfield_10105", "Request channel"}, {"customfield_10024", "Satisfaction"}, {"customfield_10099", "MCS Project"}, {"customfield_10002", "Organization"}}),
    #"Organización expandida" = Table.ExpandListColumn(#"Columnas renombradas", "Organización"),
    #"Expanded Organization1" = Table.ExpandRecordColumn(#"Expanded Organization", "Organization", {"name"}, {"name"}),
    #"Columnas renombradas1" = Table.RenameColumns(#"Expanded Organization1",{{"name", "Organization"}}),
    #"Filas filtradas" = Table.SelectRows(#"Renamed Columns1", cada true),
    #"Reacción de SLA duplicada" = Table.DuplicateColumn(#"Filas filtradas", "customfield_10038", "Hora de reacción de SLA"),
    #"Columnas renombradas2" = Table.RenameColumns(#"Reacción de SLA duplicada",{{"customfield_10038", "Reacción"}}),
    #"Reacción expandida" = Table.ExpandRecordColumn(#"Renamed Columns2", "Reaction", {"completedCycles"}, {"breached"})
en
    #"Columnas renombradas2",
    #"Reacción expandida" = Table.ExpandRecordColumn(Issues, "Reaction", {"completedCycles"}, {"completedCycles"}),
    #"Expanded completedCycles" = Table.ExpandListColumn(#"Reacción expandida", "CompletedCycles"),
    #"Expanded completedCycles1" = Table.ExpandRecordColumn(#"Expanded completedCycles", "completedCycles", {"breached"}, {"breached"}),
    #"Canal de solicitud expandido" = Table.ExpandRecordColumn(#"Expanded completedCycles1", "Request channel", {"value"}, {"value"}),
    #"Columnas renombradas" = Table.RenameColumns(#"Expanded Request channel",{{"breached", "SLA Reaction"}, {"value", "Request channel"}}),
    #"Resolución de SLA duplicada" = Table.DuplicateColumn(#"Columnas renombradas", "customfield_10037", "Hora de resolución de SLA"),
    #"Hora de resolución de SLA expandida" = Table.ExpandRecordColumn(#"Resolución de SLA duplicada", "Hora de resolución de SLA", {"id", "nombre", "_links", "completedCycles", "ongoingCycle"}),
    #"Expanded customfield_10037" = Table.ExpandRecordColumn(#"Resolución de SLA duplicada", "customfield_10037", {"completedCycles"}, {"completedCycles"}),
    #"Expanded completedCycles2" = Table.ExpandListColumn(#"Expanded customfield_10037", "completedCycles"),
    #"Expanded completedCycles3" = Table.ExpandRecordColumn(#"Expanded completedCycles2", "completedCycles", {"breached"}, {"breached"}),
    #"Columnas renombradas1" = Table.RenameColumns(#"Expanded completedCycles3",{{"breached", "SLA Resolution"}}),
    #"Columnas eliminadas" = Table.RemoveColumns(#"Renamed Columns1",{"Status Id", "Status Icon URL", "Priority Id", "Priority Icon URL"}),
    #"Enlaces de emisión expandidos" = Table.ExpandListColumn(#"Columnas eliminadas", "enlaces de problema"),
    #"Columna duplicada" = Table.DuplicateColumn(#"Enlaces de emisión expandidos", "enlaces de emisión", "enlaces de emisión - Copiar"),
    #"Enlaces de emisión expandidos1" = Table.ExpandRecordColumn(#"Columna duplicada", "enlaces de emisión", {"outissue"}, {"outissue"}),
    #"Expanded outwardIssue" = Table.ExpandRecordColumn(#"Expanded issuelinks1", "outwardIssue", {"key"}, {"key"}),
    #"Columnas renombradas2" = Table.RenameColumns(#"Expanded outwardIssue",{{"key", "LinkedIssue"}}),
    #"Enlaces de emisión expandidos - Copiar" = Table.ExpandRecordColumn(#"Renamed Columns2", "issuelinks - Copy", {"type"}, {"type"}),
    #"Tipo expandido" = Table.ExpandRecordColumn(#"Enlaces de emisión expandidos - Copiar", "type", {"outward"}, {"outward"}),
    #"Columnas renombradas3" = Table.RenameColumns(#"Tipo expandido",{{"outward", "LinkedType"}}),
    #"Agregar se escala" = Table.AddColumn(#"Renamed Columns3", "Is Escalated", cada uno si [LinkedType] = "causes" then 1 else 0, Int32.Type),
    #"Expanded customfield_10061" = Table.ExpandRecordColumn(#"Add Is Escalated", "customfield_10061", {"value"}, {"value"}),
    #"Columnas renombradas4" = Table.RenameColumns(#"Expanded customfield_10061",{{"value", "Alert Component"}}),
    #"Expanded customfield_10060" = Table.ExpandRecordColumn(#"Renamed Columns4", "customfield_10060", {"value"}, {"value"}),
    #"Columnas renombradas5" = Table.RenameColumns(#"Expanded customfield_10060",{{"value", "Alert Reason"}}),
    #"Filas filtradas" = Table.SelectRows(#"Renamed Columns5", cada Date.IsInCurrentYear([Fecha creada])),
    #"Resolución ampliada de SLA Hour1" = Table.ExpandRecordColumn(#"Filas filtradas", "Hora de resolución de SLA", {"ongoingCycle"}, {"ongoingCycle"}),
    #"Expanded ongoingCycle" = Table.ExpandRecordColumn(#"Expanded SLA Resolution Hour1", "ongoingCycle", {"breachTime"}, {"breachTime"}),
    #"Expanded breachTime" = Table.ExpandRecordColumn(#"Expanded ongoingCycle", "breachTime", {"iso8601"}, {"iso8601"}),
    #"Tipo cambiado" = Table.TransformColumnTypes(#"Expanded breachTime",{{"iso8601", escriba datetimezone}}),
    #"Hora extraída" = Table.TransformColumns(#"Tipo cambiado",{{"iso8601", Time.Hour, Int64.Type}}),
    #"Columnas renombradas6" = Table.RenameColumns(#"Extracted Hour",{{"iso8601", "Resolution breach Hour"}}),
    #"Hora de reacción de SLA expandida" = Table.ExpandRecordColumn(#"Renamed Columns6", "SLA Reaction Hour", {"completedCycles"}, {"completedCycles"}),
    #"Expanded completedCycles4" = Table.ExpandListColumn(#"Expanded SLA Reaction Hour", "completedCycles"),
    #"Expanded completedCycles5" = Table.ExpandRecordColumn(#"Expanded completedCycles4", "completedCycles", {"stopTime"}, {"stopTime"}),
    #"Expanded stopTime" = Table.ExpandRecordColumn(#"Expanded completedCycles5", "stopTime", {"iso8601"}, {"iso8601"}),
    #"Tipo cambiado1" = Table.TransformColumnTypes(#"Expanded stopTime",{{"iso8601", escriba datetimezone}}),
    #"Hora de resolución de SLA extraída" = Table.TransformColumns(#"Changed Type1",{{"iso8601", Time.Hour, Int64.Type}}),
    #"Columnas renombradas7" = Table.RenameColumns(#"Extracted SLA Resolution Hour",{{"iso8601", "Reaction breach Hour"}})
en
    #"Columnas renombradas7"

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hola @alexey-denisov ,

Resuelto: JIRA to Power BI - Comunidad de Microsoft Power BI

Tal vez puedas usar la api de reposo.

Saludos
Lionel Chen

Si este post ayuda , entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

No @v-lionel-msft !

Desafortunadamente mi código tiene más datos que el plugin jira de pago que has mencionado.

De hecho, mi error está relacionado con las columnas que expanden las operaciones que tengo.

Duplicar las columnas con los nombres "completedCycles" (o de lo contrario en los pasos expandir) hace que la aplicación de Escritorio de Power BI se bloquee.

Si elimino customfield_10038 todo funciona bien.

Así que por favor ayúdame a entender cómo obtener los valores del campo

customfiled_10037->completedCycles->stopTime->iso8601 in Hour format

de una manera más directa dentro (si es posible) sólo 1 línea.

La parte de Jira JSON para esos campos personalizados parece:

"customfield_10038": {
"id": "47",
"name": "Time to first response",
"_links": {
"self": "https://_domain_.atlassian.net/rest/servicedeskapi/request/30425/sla/47"
},
"completedCycles": [
{
"startTime": {
"iso8601": "2021-03-21T17:08:56+0300",
"jira": "2021-03-21T17:08:56.247+0300",
"friendly": "21.03.2021 17:08",
"epochMillis": 1616335736247
},
"stopTime": {
"iso8601": "2021-03-21T17:10:02+0300",
"jira": "2021-03-21T17:10:02.669+0300",
"friendly": "21.03.2021 17:10",
"epochMillis": 1616335802669
},
"breached": false,
"goalDuration": {
"millis": 1800000,
"friendly": "30m"
},
"elapsedTime": {
"millis": 66422,
"friendly": "1m"
},
"remainingTime": {
"millis": 1733578,
"friendly": "28m"
}
}
]
},

y

"customfield_10037": {
"id": "49",
"name": "Time to resolution",
"_links": {
"self": "https://_domain_.atlassian.net/rest/servicedeskapi/request/30425/sla/49"
},
"completedCycles": [
{
"startTime": {
"iso8601": "2021-03-21T17:08:56+0300",
"jira": "2021-03-21T17:08:56.247+0300",
"friendly": "21.03.2021 17:08",
"epochMillis": 1616335736247
},
"stopTime": {
"iso8601": "2021-03-21T17:19:16+0300",
"jira": "2021-03-21T17:19:16.300+0300",
"friendly": "21.03.2021 17:19",
"epochMillis": 1616336356300
},
"breached": false,
"goalDuration": {
"millis": 86400000,
"friendly": "24h"
},
"elapsedTime": {
"millis": 620053,
"friendly": "10m"
},
"remainingTime": {
"millis": 85779947,
"friendly": "23h 49m"
}
},
{
"startTime": {
"iso8601": "2021-03-22T15:57:49+0300",
"jira": "2021-03-22T15:57:49.056+0300",
"friendly": "22.03.2021 15:57",
"epochMillis": 1616417869056
},
"stopTime": {
"iso8601": "2021-03-22T15:57:54+0300",
"jira": "2021-03-22T15:57:54.510+0300",
"friendly": "22.03.2021 15:57",
"epochMillis": 1616417874510
},
"breached": false,
"goalDuration": {
"millis": 86400000,
"friendly": "24h"
},
"elapsedTime": {
"millis": 5454,
"friendly": "0m"
},
"remainingTime": {
"millis": 86394546,
"friendly": "23h 59m"
}
},
{
"startTime": {
"iso8601": "2021-03-22T16:17:44+0300",
"jira": "2021-03-22T16:17:44.969+0300",
"friendly": "22.03.2021 16:17",
"epochMillis": 1616419064969
},
"stopTime": {
"iso8601": "2021-03-22T16:17:51+0300",
"jira": "2021-03-22T16:17:51.542+0300",
"friendly": "22.03.2021 16:17",
"epochMillis": 1616419071542
},
"breached": false,
"goalDuration": {
"millis": 86400000,
"friendly": "24h"
},
"elapsedTime": {
"millis": 6573,
"friendly": "0m"
},
"remainingTime": {
"millis": 86393427,
"friendly": "23h 59m"
}
},
{
"startTime": {
"iso8601": "2021-03-22T16:17:54+0300",
"jira": "2021-03-22T16:17:54.947+0300",
"friendly": "22.03.2021 16:17",
"epochMillis": 1616419074947
},
"stopTime": {
"iso8601": "2021-03-26T12:49:58+0300",
"jira": "2021-03-26T12:49:58.038+0300",
"friendly": "26.03.2021 12:49",
"epochMillis": 1616752198038
},
"breached": true,
"goalDuration": {
"millis": 86400000,
"friendly": "24h"
},
"elapsedTime": {
"millis": 333123091,
"friendly": "92h 32m"
},
"remainingTime": {
"millis": -246723091,
"friendly": "-68h 32m"
}
},
{
"startTime": {
"iso8601": "2021-03-26T15:26:02+0300",
"jira": "2021-03-26T15:26:02.225+0300",
"friendly": "26.03.2021 15:26",
"epochMillis": 1616761562225
},
"stopTime": {
"iso8601": "2021-03-26T15:44:19+0300",
"jira": "2021-03-26T15:44:19.302+0300",
"friendly": "26.03.2021 15:44",
"epochMillis": 1616762659302
},
"breached": false,
"goalDuration": {
"millis": 86400000,
"friendly": "24h"
},
"elapsedTime": {
"millis": 1097077,
"friendly": "18m"
},
"remainingTime": {
"millis": 85302923,
"friendly": "23h 41m"
}
}
]
},

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors