Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReleasedBy value of a UserStory is always Null #181

Open
M-ahuja opened this issue Oct 11, 2021 · 5 comments
Open

ReleasedBy value of a UserStory is always Null #181

M-ahuja opened this issue Oct 11, 2021 · 5 comments

Comments

@M-ahuja
Copy link

M-ahuja commented Oct 11, 2021

I am trying to fetch the ReleasedBy Value of a userStory but the object always returns Null Value though the UserStory has been released.

@M-ahuja M-ahuja changed the title ReleasedBy value is of a UserStory Null ReleasedBy value of a UserStory Null Oct 11, 2021
@M-ahuja M-ahuja changed the title ReleasedBy value of a UserStory Null ReleasedBy value of a UserStory is always Null Oct 11, 2021
@klehman-rally
Copy link
Member

Do you have some sample code that illustrates the problem? What happens as a result of a query including the condition of either 'ReleasedBy is null' or 'ReleasedBy != null' ? As it looks like 'ReleasedBy' is a custom field, I would not expect the UI to enforce setting that value when a Release value is set, so it is possible that the condition you see is actually "correct" for the scenario where the ReleasedBy value has not been set.

@M-ahuja
Copy link
Author

M-ahuja commented Oct 11, 2021

My requirement is to find out who released the userstory in prod environment.
In UI whenever any UserSrtory has been released to Prod environment we set the ScheduleState to "Released To Prod" {Attachment 1 for reference} and who released it shows in Revision History {Attachment 2 for reference}.

Attachment 1:
Attachment 1

Attachment 2:
Attachment 2

When I get the user story attribute details, "ReleasedBy" is always None. I am expecting the value here because the object has the attribute and it must show the correct value.

Sample Code:

rally = Rally('rally1.rallydev.com', apikey='12345',workspace='ABCD Workspace',project='myProject')

story = rally.get('UserStory', query='Release.Name contains 21.2', fetch=True,order="Iteration,FormattedID", threads=1)

for us in story:
#Below UserStroy FormattedId Schedule State is "Released To Prod"
    if us.FormattedID=="US12345xxxx":
                print(us.details())

Output:
ReleasedBy : None
ReleasedtoProdDate : None
FlowState : FlowState.ref (OID xxxxxxxxxxxxx Name Released to Prod)
FlowStateChangedDate : 2021-06-04T08:23:18.348Z

@klehman-rally
Copy link
Member

Thank you for the great info regarding your request!
Note that in attachment 2 the block of Revision History shows the fields that were changed and 'RELEASED BY' is not explicitly mentioned in there. For the example you provided, 'Pragati Gupta5' would appear to be the user that modified the Story's 'SCHEDULE STATE' and 'FLOW STATE' to 'Released to Prod'. But, from that same example, notably missing is any evidence that 'Pragati Gupta5' set or modified the 'ReleasedBy' value to reflect that action. So, relying solely on having a value in the 'ReleasedBy' field as an indication that a Story has been 'Released to Prod' is not always correct. You would have to look at the Revisions in the RevisionHistory to determine the User that transitioned one or both of ScheduleState / FlowState to the 'Released to Prod' value.
You could confirm this by having two 'exemplar' Stories, that both start out in some early status like 'Open' or 'Submitted' or similar and then make similar modifications to both in other attributes like Name, Description, Owner, StoryPoints etc.
Then in one of them, transition both the ScheduleState and FlowState to 'Released to Prod' AND update the 'ReleasedBy' attribute to yourself (or any other valid user in the relevant workspace and project). On the other Story, only change the 'ScheduleState' to 'Released to Prod' without updating the 'ReleasedBy' attribute.
Running your Python script again, you should see that the 'ReleasedBy' attribute is not null for the first Story but is null for the second Story.

@M-ahuja
Copy link
Author

M-ahuja commented Oct 13, 2021

I do not see any ReleasedBy field in UI to be updated. Could you please confirm where I can find ReleasedBy field in UI or how pyral package is fetching this attribute value?

@klehman-rally
Copy link
Member

In the Rally subscriptions I have access to (none that are customer subscriptions...) ReleasedBy is not present as a standard field in any entity in the Rally object model. I conjecture that ReleasedBy is a custom field for at least HierarchicalRequirement in the subscription you are working in. As custom field, unless that is referenced in a custom app or on a dashboard created in your organization, there isn't anywhere in the standard Rally application where that attribute is surfaced for display or interaction.
In the schema for HierarchicalRequirement for your subscription, that attribute is actually identified as 'c_ReleasedBy' with the leading 'c_' prefix denoting a custom field. When a get operation is called using a pyral Rally instance, if the fetch argument is True or the string list includes 'ReleasedBy' (note here the absence of the 'c_' prefix...) then the request result will include the information for the 'ReleasedBy' attribute. When processing the response in the normal iterative form, ie., 'for story in response: ' you can access via the dot operator -> story.ReleasedBy .
Hope this helps...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants