<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dealing with Atlassian object format in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5851#M2566</link>
    <description>&lt;P&gt;Ok I had a type in there... and decided that having 1 key value pair per object in the array wouldn't serve me very well. So I ChatGPT'd some more Ruby and I think I have a decent transform happening now!&lt;/P&gt;&lt;P&gt;My last wish list would be to change each of the ID# keys into the text name equivalent... but those are in a separate array. This will take some thinking.&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;## provide the findIdentifiers array as your "data" input and grab it
array = input["data"]

## create an empty array to store your keepers
itemsToKeep = []

new_object= {}

## loop through findIdentifiers
array.each { | a | 
  
  new_object[a["objectTypeAttributeId"]] = a["objectAttributeValues"][0]["displayValue"] 
}

itemsToKeep.push(new_object)

## create the output object with itemsToKeep as the value
{result: itemsToKeep}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="runelynx_1-1702683204678.png" style="width: 400px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/942i135FFEC8B551A5E1/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="runelynx_1-1702683204678.png" alt="runelynx_1-1702683204678.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Dec 2023 23:34:34 GMT</pubDate>
    <dc:creator>runelynx</dc:creator>
    <dc:date>2023-12-15T23:34:34Z</dc:date>
    <item>
      <title>Dealing with Atlassian object format</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5847#M2564</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having a very tough time figuring out how to work with objects I get from Atlassian's API. Because their objects have so many custom fields, they don't use simple key-value pairs.&lt;/P&gt;&lt;P&gt;As an example, the object within the Values array here represents a specific laptop asset. Within the Attributes array in that object, the laptop's attributes are listed. However I cannot identify attributes programmatically using the attribute names... or even IDs... because of the formatting.&lt;/P&gt;&lt;P&gt;In order to get the "UDID" attribute value for this laptop, I need to find the object within the Attributes array where "Object type attribute ID" = 325. When I find that object, I need to look to the "Object attribute values" array within the object... look at the first object within that array, and use the value associated with the "Value" key.&lt;/P&gt;&lt;P&gt;How on earth can I make this work with Workato? Atlassian has made this SO complicated.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="runelynx_0-1702680428529.png" style="width: 400px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/940i82AF3F2B6503BC9D/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="runelynx_0-1702680428529.png" alt="runelynx_0-1702680428529.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 22:50:12 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5847#M2564</guid>
      <dc:creator>runelynx</dc:creator>
      <dc:date>2023-12-15T22:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Atlassian object format</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5849#M2565</link>
      <description>&lt;P&gt;I'm giving this a try using Ruby from a solution provided &lt;A href="https://systematic.workato.com/t5/workato-pros-discussion-board/can-we-filter-a-complex-structure/m-p/5777" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my Ruby so far (don't mind the comments, it's part of the copy-pasta)&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;## provide the findIdentifiers array as your "data" input and grab it
array = input["data"]

## create an empty array to store your keepers
itemsToKeep = []

## loop through findIdentifiers
array.each { | a | 
  
  new_object = { a["objectAttributeTypeId"] =&amp;gt; a["objectAttributeValues"][0]["value"] }
  
  ## test the type value with a ternary operation, 
  ## which is just simplified shorthand for an if statement.
  ## if the type is right, push it to itemsToKeep
  itemsToKeep.push(new_object)
  
}

## create the output object with itemsToKeep as the value
{result: itemsToKeep}&lt;/LI-CODE&gt;&lt;P&gt;... and this is the result. The keys are completely missing for some reason. Going to keep chipping away at this...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="runelynx_0-1702682745663.png" style="width: 400px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/941i4D39FE6E5020812B/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="runelynx_0-1702682745663.png" alt="runelynx_0-1702682745663.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 23:27:31 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5849#M2565</guid>
      <dc:creator>runelynx</dc:creator>
      <dc:date>2023-12-15T23:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Atlassian object format</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5851#M2566</link>
      <description>&lt;P&gt;Ok I had a type in there... and decided that having 1 key value pair per object in the array wouldn't serve me very well. So I ChatGPT'd some more Ruby and I think I have a decent transform happening now!&lt;/P&gt;&lt;P&gt;My last wish list would be to change each of the ID# keys into the text name equivalent... but those are in a separate array. This will take some thinking.&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;## provide the findIdentifiers array as your "data" input and grab it
array = input["data"]

## create an empty array to store your keepers
itemsToKeep = []

new_object= {}

## loop through findIdentifiers
array.each { | a | 
  
  new_object[a["objectTypeAttributeId"]] = a["objectAttributeValues"][0]["displayValue"] 
}

itemsToKeep.push(new_object)

## create the output object with itemsToKeep as the value
{result: itemsToKeep}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="runelynx_1-1702683204678.png" style="width: 400px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/942i135FFEC8B551A5E1/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="runelynx_1-1702683204678.png" alt="runelynx_1-1702683204678.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 23:34:34 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5851#M2566</guid>
      <dc:creator>runelynx</dc:creator>
      <dc:date>2023-12-15T23:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Atlassian object format</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5853#M2567</link>
      <description>&lt;P&gt;Hallelujah!!! Made a few changes to process the larger object containing both arrays... first define the ugly object using IDs but simplifying the ID-Name relationship. Then go back through that object and replace the IDs with names using the 2nd array.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/1188"&gt;@gary1&lt;/a&gt;&amp;nbsp;for the code that got me started!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="runelynx_0-1702684789488.png" style="width: 400px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/943i60A7DBEC996B8E3C/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="runelynx_0-1702684789488.png" alt="runelynx_0-1702684789488.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;## provide the findIdentifiers array as your "data" input and grab it
inputObject = input["data"]

attributesArray = inputObject["values"][0]["attributes"]
definitionsArray = inputObject["objectTypeAttributes"]

new_object= {}

## loop through findIdentifiers
attributesArray.each { | a | 
  
  new_object[a["objectTypeAttributeId"]] = a["objectAttributeValues"][0]["displayValue"] 
}

## loop through findIdentifiers
definitionsArray.each { | a | 
   ## dig up the type value; this assumes only one object in the Type array 
  typeId = a["id"]
  
  if new_object.has_key?(typeId)
    # Rename "old_key" to "new_key"
	new_key = a["name"]
	old_key_value = new_object.delete(typeId)
	new_object[new_key] = old_key_value
  end
}

## create the output object with itemsToKeep as the value
{result: new_object}&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 16 Dec 2023 00:00:08 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5853#M2567</guid>
      <dc:creator>runelynx</dc:creator>
      <dc:date>2023-12-16T00:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Atlassian object format</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5854#M2568</link>
      <description>&lt;P&gt;I was actually responding to your first comment but got sidetracked. Glad you figured it out! : )&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 00:38:20 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5854#M2568</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2023-12-16T00:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Atlassian object format</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5856#M2569</link>
      <description>&lt;P&gt;Hey &lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/9882"&gt;@runelynx&lt;/a&gt;&amp;nbsp;, could you share the raw JSON response using the "Copy Raw JSON" button?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="javierriesco_0-1702723452278.png" style="width: 400px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/944i1EEE5023A6E03011/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="javierriesco_0-1702723452278.png" alt="javierriesco_0-1702723452278.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If the response has a fixed schema, it shouldn’t be difficult to retrieve the specific field you need without using Ruby code.&lt;/P&gt;&lt;P&gt;&lt;!--  notionvc: ea13161e-ef1b-4d16-adb5-4b1139a85ba0  --&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 10:45:00 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5856#M2569</guid>
      <dc:creator>javier-riesco</dc:creator>
      <dc:date>2023-12-16T10:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Atlassian object format</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5857#M2570</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/9882"&gt;@runelynx&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I started a few days ago with a new Jira Assets connector, as I also couldn't believe how people show handle that super-complicated data format Jira Assets is using. I tried to abstract from the underlying technical stuff and make it simple to use the connector.&amp;nbsp;&lt;BR /&gt;Created a short video to show/illustrate how it works:&amp;nbsp;&lt;A href="https://youtu.be/0R5aRcAuqdA" target="_blank"&gt;https://youtu.be/0R5aRcAuqdA&lt;/A&gt;&lt;BR /&gt;&lt;STRONG&gt;Import to note:&lt;/STRONG&gt; In order to handle the Object-Type-Schema properly, you have to configure the Object-Type as part of the action.&amp;nbsp; Depending on the number of object types you have it would required a number of If-Statements, but there is no other around it, as the Schema needs to be know and Config-Time.&lt;BR /&gt;Would that be okay for your use-case?&lt;BR /&gt;&lt;BR /&gt;Please let me know your feedback. I'm also happy to share this connector with you once I'm happy with it.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 11:49:13 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5857#M2570</guid>
      <dc:creator>chris-wiechmann</dc:creator>
      <dc:date>2023-12-16T11:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with Atlassian object format</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5908#M2598</link>
      <description>&lt;P&gt;Happy new year!&lt;BR /&gt;The new Jira Assets connector is now avilable in the community library:&lt;BR /&gt;&lt;A href="https://app.workato.com/custom_adapters/513076/details?community=true" target="_self"&gt;https://app.workato.com/custom_adapters/513076/details?community=true&lt;/A&gt;&lt;BR /&gt;Please let me know, if this works for your use-case(s) or if you miss anything.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 07:18:18 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/dealing-with-atlassian-object-format/m-p/5908#M2598</guid>
      <dc:creator>chris-wiechmann</dc:creator>
      <dc:date>2024-01-04T07:18:18Z</dc:date>
    </item>
  </channel>
</rss>

