Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing blocker.BlockedBy

Tags:

rally

Using Rally SDK 2.0, I am customizing the kanban board app. One of the items I am doing is trying to add who set the story to BLOCKED status.

When debugging it seems ok, but for some reason my blocker.BlockedBy is set to undefined. I am guessing I need to do something a bit different than this?

var blocker = this.getRecord().get("Blocker");

// blocker.BlockedBy is undefined right here // blocker seems populated, but I am not sure its actually a Blocker object.

I added "Blocker" to the additional fields for the card as well getAdditionalFetchFields: function () { return ['Owner', 'FormattedID', 'Blocked', 'Ready', 'Priority', 'DefectStatus', 'Defects', "PlanEstimate", "LastUpdateDate", "TaskStatus", "Blocker"];

In the documentation it says that type Blocker is " non-creatable type", so not sure what this actually means...

Seems like the object coming back from the call has a _type field defining it as "Blocker".

Kinda stuck, I have tried typecasting the result to a Blocker, but still not having much luck. Just want to get who blocked the story :)

like image 590
user1537867 Avatar asked Mar 27 '26 02:03

user1537867


1 Answers

By adding Blocker as a fetch field, it's only returning a simple ref object that represents the Blocker object. But you can also tell fetch to fetch Blocker fields. So if you add BlockedBy as another field to fetch, it will grab that for your Blockers. WSAPI does a little magic here to figure out that you mean BlockedBy on the Blocker object.

BlockedBy is a User object, so the easiest way from there to get the user's name is with

var blockerName = this.getRecord().get('Blocker').BlockedBy._refObjectName;
like image 187
Matt Greer Avatar answered Mar 29 '26 10:03

Matt Greer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!