Rally query for tasks related to a user story with a specific parent - rally

How do I write a Rally query to give me all the Rally tasks for a user story which has a parent user story that has a specific ID?
For an ID of "S666", this works for tasks:
(WorkProduct.FormattedID = "S666")
And this works for user stories:
(Parent.FormattedID = "S666")
However, when I try the following:
(WorkProduct.Parent.FormattedID = "S666")
Then I get this error:
Could not parse: Could not traverse to "Parent" on type Artifact in the query segment "WorkProduct.Parent.FormattedID"

Unfortunately you won't be able to do this directly from the task endpoint due to the error you found above. Since the WorkProduct field on Task is of type Artifact (not necessarily a story- could be a Defect, etc.) it has no Parent field.
However you should be able to query for stories where (Parent.FormattedID = "S666") and include Tasks (and any fields on Task you're interested in) in your fetch.
"/hierarchicalrequirement.js?query=(Parent.FormattedID = "S666")&fetch=Tasks,FormattedID,Name,Owner,State,Actuals,Estimate,ToDo"

Related

SharePoint Online Microsoft.SharePoint.SPQueryThrottledException from workflow

Background: Our SharePoint Task list threshold limit reached, means items are more than 5000. We have created custom view to manage the data view with help of indexed columns.
But there is logic in SharePoint 2013 designer workflow in which we need to get description column and few other columns of task which gets completed to save it as history purposes (which user took what action and when).
Now to get information we use GUID return by Assign a task action of designer and query the completed task.
Problem: Our SP designer workflow call for task list and filter items based on GUID. Below is the sample screenshot of call from designer.
SharePoint Call to our list
and once reaching this step it throws an error in workflow, and workflow got suspended, when I drill down the reason it was due to threshold limit, I tested it on browser as shown below
Error that throw by above call in worklfow
My Approach:
To cater above problem i only have 2 points in mind:
1) To call above by Item ID instead of GUID becuase Item ID will be indexed by defauly, but Assign a task action of SharePoint designer workfow return TaskID that contains GUID so that is the reason to filter items based on GUID, but GUID is not indexed columns, so it throw Microsoft.SharePoint.SPQueryThrottledException.
2) Need to make GUID as indexed column so that threshold error can be cater. but in list settings GUID cannot be set as indexed column as its not listed there.
Question:
Is there any solution or any other way so that we can get information related to task in designer once the task completed.
We had exactly the same problem in a SharePoint Online environment. SharePoint Designer WF generates a REST call like this to get a task from the WF's associated task list:
https://site/web/_api/web/lists(guid'1b7a4526-47da-4040-8df1-ba8a97543188')/Items?%24filter=**GUID**+**eq**+guid%2771c23273-2535-4dbb-869d-c3e608899ca0%27&%24select=ID%2CEditorId
I put an index on the 'GUID' column through powershell:
Add-PSSnapin Microsoft.sharepoint.powershell
$web = get-spweb '<URL>'
$list = $web.Lists['Workflow Tasks']
$field = $list.Fields['GUID']
$field.Indexed = $true
$field.Update()
$list.FieldIndexes.Add($field)
(You have to ensure that there are no more than 5000 items in the list before you can create the index)
We did it one week ago and all the suspended workflows are resumed successfully. Now there are ~5100 items in the task list and no problem with the GUID filter.

find nodes with a specific child association

I am looking for a query (lucene, fts-alfresco or ...) to return all the document which have a specific child association (that is not null).
Some context:
Documents of type abc:document have a child-association abc:linkedDocument.
Not all document have an other document linked to them, some have none some have one or multiple.
I need a fast and easy way to get an overview of all the documents that do have at least one document linked to them.
Currently I have a webscript that does what I need, but prefer not to have tons of webscripts which are not business related.
code:
SearchParameters sp = new SearchParameters();
String query = "TYPE:\"abc:document\"";
StoreRef store = StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
sp.addStore(store);
sp.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO);
sp.setQuery(query);
ResultSet rs = services.getSearchService().query(sp);
List<NodeRef> nodeRefs = rs.getNodeRefs();
for (NodeRef ref : nodeRefs) {
List<ChildAssociationRef> refs = services.getNodeService().getChildAssocs(ref);
for(ChildAssociationRef chref : refs){
if(chref.getQName().equals(AbcModel.ASSOC_LINKED_DOC)){
logger.debug("Document with linked doc: {}", ref);
break;
}
}
}
Associations aren't query-able so you'll have to do what you are doing, which is essentially checking every node in a result set for the presence of a desired association.
The only improvement I can suggest is that you can ask for the child associations of a specific type which would prevent you from having to check the type of every child association, see How to get all Child associations with a specific Association Type Alfresco (Java)

Is there a way to apply a filter to a treestore that includes a property that does not exist on one of the models specified?

I am trying to populate a treegrid with user stories and defects, but one of the parameters that I would like to use in the filter is a property that does not exist on the defect model.
If the filter includes that property, no results are returned. Is there a workaround or special filter definition?
The treegrid/treestore request data from the artifact wsapi endpoint. There is a hidden queryable field called TypeDefOid that you can use to limit a filter to a specific type, like so:
((TypeDefOid != <defectTypeDefOid>) OR ((TypeDefOid = <defectTypeDefOid>) AND (DefectField = "value")))
You can obtain the defectTypeDefOid from the model once the treestore is built:
var defectTypeDefOid = treeStoreModel.getArtifactComponentModel('Defect').typeDefOid;
You can see a good example of this in action in the IterationTrackingBoardApp here:
https://github.com/RallyApps/app-catalog/blob/master/src/apps/iterationtrackingboard/IterationTrackingBoardApp.js#L227
That example is for story, but very similar. Just below that in the code is also a more complicated defect specific filter as another example.

What is the best way to find out the candidate group a task?

After I loaded a List of tasks with a taskQuery
taskService.createTaskQuery()
.processDefinitionKey(PROCESSKEY)
.taskCandidateGroupIn(list).initializeFormKeys().list()
What is the best way to find out the candidate group of every task?
I want to display it in a JSF view, but the class Task has no corresponding field.
You can get a task's identity links using the task service. Among other relations, the candidate group relation is expressed as an identity link. The following code filters a task's identity links for those that represent candidate groups:
List<IdentityLink> identityLinks = taskService.getIdentityLinksForTask(task.getId());
for (IdentityLink identityLink : identityLinks) {
String type = identityLink.getType();
/* type corresponds to the constants defined in IdentityLinkType.
"candidate" identitifies a candidate relation */
String groupId = identityLink.getGroupId();
if (IdentityLinkType.CANDIDATE.equals(type) && groupId != null) {
// we have found a candidate group; do something
}
}
The best approach is to write a custom query that gives you all task information the way you need them with on select. You do not want to start looping over result lists and sending one or more query per item, especially not in a high performance application as your task list.
Check the custom query documentation for details.
Only select task which have a candidate groups.
List<Task> candidateGroupList = taskService.createTaskQuery().withCandidateGroups().list();

Siebel - How to get all accounts of an employee with eScript?

how can I get all accounts of am employee?
In the "Siebel Object Interaces Reference" I found an example, how to get all industries of an account:
var myAccountBO = TheApplication().GetBusObject("Account");
var myAccountBC = myAccountBO.GetBusComp("Account");
var myAssocBC = myAccountBC.GetMVGBusComp("Industry");
So I would like to do something like:
var myEmployeeBO = TheApplication().GetBusObject("Employee");
var myEmployeeBC = myAccountBO.GetBusComp("Employee");
var myAssocBC = myAccountBC.GetMVGBusComp("Account");
But I get an error
Semantic Warning around line 23:No such predefined property Account in class BusComp[Employee].MVGFields.
I can see in Tools that there is no Multi Value Link called "Account" in Business Component "Employee", so I can actually understand the error message.
So I wonder how I can get all accounts of an employee.
I found the Business Component "User" which has a Multi Value Link to "Organisation" and another link "User/Account".
Is this what I am looking for?
How can I know? Where is documentation which tells me about the semantics of links? (Is this described in "Siebel data model reference"? I cannot download this document, although I have signed in...) This link could also link a user to the organization it belongs to.
If one of these links IS what I am looking for, what would be the way to go to get the "User" Business Component of a corresponding "Employee" Business Component?
Many questions of a Siebel newb...Thanks for your patience.
Nang. An easy way to approach this (and to learn it) is to figure out how you'd do it in the UI. Then move onto figuring out how to do the same thing in script.
When you say, "get all account of an employee," do you really mean get all accounts where a particular employee is on the account team? In the UI, that would be done by going to: Accounts > All Accounts Across Organizations, and querying for that specific user in the "Account Team" multi-value field.
From that same view, go to Help > About View in the application menu. You'll see in the popup that the view uses the Account business object and the Account business component. A quick examination of the applet you queried on will show you that the "Account Team" field on the applet is really the "Sales Rep" field on the Account business component. Here's how to mimic what we did in the UI, in script:
var boAccount = TheApplication().GetBusObject("Account");
var bcAccount = boAccount.GetBusComp("Account");
bcAccount.SetViewMode(AllView); // like All .. Across Orgs
bcAccount.ClearToQuery();
bcAccount.SetSearchSpec("Sales Rep", "NANG");
bcAccount.ExecuteQuery();
Then you can walk through the list of accounts and do something with each one like this:
// for each account
for (var bIsRowActive = bcAccount.FirstRecord();
bIsRowActive; b = bcAccount.NextRecord())
{
// do something here
}
I hope you're enjoying Siebel.