Question

Deriving Structure Metadata from API Widget

  • 9 June 2020
  • 4 replies
  • 432 views

If i use the API to query a widget on a Kanban board, I get an X and Y co-ordinate, but I don’t seem to see any reference to the structure of the board itself eg Swimlane/Bucket name or indeed the fact that the widget is contained within a particular swimlane/column.

Am I missing something.  Is there some API call that allows me to further discover the structure and relationship between widgets?


4 replies

Hi @Gerald Dunn,

 

You are right, the API doesn’t expose any relationship information right now. We are aware of this & might change this in the future.

May I ask what is your use case for this?

 

Best,
Ahmed

Hi Ahmed,

 

We want to use changes in the miro cards to drive changes in our task database (Dynamics).  I have a call into Miro support to explore development on this, but if you have any comments they would be very welcome.

@Ahmed El Gabri, there are a lot of automation tasks that can benefit from knowing some concept of containment of objects.  We would really like to be able to do Agile PI planning directly in Miro where we could drag stories between sprints and have the backing data get updated.  This is something that one of your competitors (Stormboard) does really well.  We almost went with them instead of Miro.

Userlevel 4

If you take the approach of a web plugin via Miro SDK - you will be able to access all the information and events (*I believe) you’d need to write the logic and flow to accomplish this. 

  • Event: Widget moved over another widget:  Event-Listener: WIDGETS_TRANSFORMATION_UPDATED
  • Property: Widget bounds, x, y, width, height
  • Property / structure: What widgets are lines connected to? (not sure you need this): line start widget ID, end widget ID

At this point, to my knowledge, you’d have to implement the ‘is object A within the bounds of object B’ test from the ground up (like, is card #3 in swimlane A or B, or list all cards in swimlane A). 

It would be great if Miro produced a method for testing ‘is widget A within the bounds of widget B’. Otherwise its not a rocket science helper function to build from ground up on our own.  Also a related method, ‘is object a overlapping any objects’

 

There is an ‘experimental feature’ method listed in the typings file with no documentation called “__getIntersectedObjects()     I thought for a while that this was ‘get all the widgets within the bounds of object B’.   --- but my experiments with it failed to produce anything understandable…I’m not sure its working properly - or if i’m using it incorrectly. 

	 * Requires scope: BOARDS:READ
* [Experimental feature] Find all widgets intersected with passed area
*/
__getIntersectedObjects(pointOrRect: IPoint | IRect): Promise<IWidget[]>

 

Reply