How to get sprint or iteration details of a project in rtc jazz using OSLC - rtc

Can any one help me to get the list of iterations and sprints in that and workitems in that sprint using oslc or REST call

This thread reports that querying iterations might be a bit tricky:
For the purpose of obtaining iteration for specific development line. Reporting Rest I/F may helps.
https://clm.example.com:9443/ccm/rpt/repository/foundation?fields=foundation/iteration[developmentLine/name='RTC V4.0.6 Development']/(id|name|developmentLine/name)
This yields some thing like:
<iteration> <developmentline> <name> <iteration>
<developmentline><name>RTC V4.0.6 Development</name></developmentline>
<id>Sprint 2</id>
<name>Sprint 2</name>
</iteration> </name> </developmentline> </iteration>
Unfortunately, iteration belongs to development line, so we have to query developmentLine using like:
https://clm.example.com:9443/ccm/rpt/repository/foundation?fields=foundation/developmentLine/(name|projectArea/name)
For the brief introduction to reportable RestAPI, refer to this web pages.
https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI
Good feature of this reports API is that we can query by name, not uuid of objects.

There
I had also this problems solved by this way. Try it.
It returns list of Open Sprints.
http://jira.address/rest/greenhopper/1.0/sprint/picker
If you want to search for closed sprints in the future, you can use the following parameter in the above call:
http://jira.address/rest/greenhopper/1.0/sprint/picker?excludeCompleted=false

Related

Using an API to Extract All Comments from a Reddit Post

I am using the Reddit API (Pushshift) : https://github.com/pushshift/api
Using the documentation, I understand how I can use this to extract every comment containing the word "covid" that was left in a certain time period:
https://api.pushshift.io/reddit/search/comment?q=covid&after=3h&before=2h&size=1
The output looks something like this:
{"data":[{"subreddit_id":"t5_2qh6p","author_is_blocked":false,"comment_type":null,"edited":false,"author_flair_type":"richtext","total_awards_received":0,"subreddit":"Conservative","author_flair_template_id":null,"id":"j98zf27","gilded":0,"archived":false,"collapsed_reason_code":null,"no_follow":false,"author":"VamboRoolOkay","send_replies":true,"parent_id":41917615743,"score":1,"author_fullname":"t2_7uxkru5f","all_awardings":[],"body":"I will never believe that election fraud wasn't a significant factor. Go ahead - call it a conspiracy theory. But I also maintained that Covid was lab-created. Truth is the Daughter of Time.","top_awarded_type":null,"author_flair_css_class":null,"author_patreon_flair":false,"collapsed":false,"author_flair_richtext":[{"e":"text","t":"Conservative"}],"is_submitter":false,"gildings":{},"collapsed_reason":null,"associated_award":null,"stickied":false,"author_premium":false,"can_gild":true,"link_id":"t3_116l7ct","unrepliable_reason":null,"author_flair_text_color":"dark","score_hidden":true,"permalink":"/r/Conservative/comments/116l7ct/kamala_harris_plans_on_running_with_biden_in_2024/j98zf27/","subreddit_type":"public","locked":false,"author_flair_text":"Conservative","treatment_tags":[],"created_utc":1676866031,"subreddit_name_prefixed":"r/Conservative","controversiality":0,"author_flair_background_color":"","collapsed_because_crowd_control":null,"distinguished":null,"retrieved_utc":1676866047,"updated_utc":1676866048,"body_sha1":"328df3784d15f77b98a84418c4ce720822227cfe","utc_datetime_str":"2023-02-20 04:07:11"}],"error":null,"metadata":{"es":{"took":98,"timed_out":false,"_shards":{"total":828,"successful":828,"skipped":824,"failed":0},"hits":{"total":{"value":573,"relation":"eq"},"max_score":null}},"es_query":{"size":1,"query":{"bool":{"must":[{"bool":{"must":[{"simple_query_string":{"fields":["body"],"query":"covid","default_operator":"and"}},{"range":{"created_utc":{"gte":1676862433000}}},{"range":{"created_utc":{"lt":1676866033000}}}]}}]}},"aggs":{},"sort":{"created_utc":"desc"}},"es_query2":"{\"size\":1,\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must\":[{\"simple_query_string\":{\"fields\":[\"body\"],\"query\":\"covid\",\"default_operator\":\"and\"}},{\"range\":{\"created_utc\":{\"gte\":1676862433000}}},{\"range\":{\"created_utc\":{\"lt\":1676866033000}}}]}}]}},\"aggs\":{},\"sort\":{\"created_utc\":\"desc\"}}","api_launch_time":1673017478.254743,"api_request_start":1676873233.6143198,"api_request_end":1676873233.7406816,"api_total_time":0.12636184692382812}}
My Question: Suppose I identify a post that contains the word "covid" - now, I want to retrieve every comment on this post : Is this possible to do?
For instance, based on the output of these results, I see that :
link_id: t3_116l7ct
parent_id:41917615743
Can I somehow use this information to write an API query to retrieve all comments from this post?
I tried the following query but got an empty result: https://api.pushshift.io/reddit/comment/search/?link_id=t3_116cjib
Thanks!

Avoid duplicates in the destination schema

I have a little problem. I want to map every detail line to one OrderInfo. The destination schema can not have any duplicate OrderInfo. All the detail lines should be in the destination orderInfo, but the SuppliersOrderNo and BuyersOrderNo should not be twice.
Any ideas how to do this, is it possible to use XSL or inline script?
<inv:OrderInfo>
<inv:SuppliersOrderNo>123456</inv:SuppliersOrderNo>
<inv:BuyersOrderNo>6789</inv:BuyersOrderNo>
<inv:DetailLines>
<inv:DetailLine>
<inv:InvoiceDetailLineNo>1</inv:InvoiceDetailLineNo>
<inv:Item>
<inv:SuppliersArticleNo>article2</inv:SuppliersArticleNo>
<inv:SuppliersDescription>BestArticle</inv:SuppliersDescription>
</inv:Item>
</inv:DetailLine>
<inv:DetailLine>
<inv:InvoiceDetailLineNo>2</inv:InvoiceDetailLineNo>
<inv:Item>
<inv:SuppliersArticleNo>article3</inv:SuppliersArticleNo>
<inv:SuppliersDescription>AlmostBestArticle</inv:SuppliersDescription>
</inv:Item>
</inv:DetailLine>
</inv:DetailLines>
</inv:OrderInfo>
<inv:OrderInfo>
<inv:SuppliersOrderNo>123456</inv:SuppliersOrderNo>
<inv:BuyersOrderNo>6789</inv:BuyersOrderNo>
<inv:DetailLines>
<inv:DetailLine>
<inv:InvoiceDetailLineNo>1</inv:InvoiceDetailLineNo>
<inv:Item>
<inv:SuppliersArticleNo>article1337</inv:SuppliersArticleNo>
<inv:SuppliersDescription>WOW</inv:SuppliersDescription>
</inv:Item>
</inv:DetailLine>
</inv:DetailLines>
</inv:OrderInfo>
If you want to do this purely in XSLT, you'll have to use Muenchian gruoping. I wrote a blog that links to some other blogs on how to do this in BizTalk a little while back: https://blog.tallan.com/2014/12/09/muenchian-grouping-in-biztalk-while-keeping-mapper-functionality/
To summarize the blog: if you pursue this, you'll need a map that's completely custom XSLT somewhere, but you could put it into a custom pipeline component if you still want to be able to use "regular" maps functionality without any other caveats (in my blog I describe a method of doing that in a pipeline component so that a "regular" BizTalk map can still be used on the preprocessed output). There are lots of resources on Muenchian grouping out there (including on StackOverflow), so I'm not rehashing all of that in this answer.
You could also try to serialize the message in a C# component and use some LINQ methods to group/sort/order/etc, or if you're inserting the content into SQL at some point you could do it in SQL (which would be able to handle this kind of task more naturally).

Timestamp of builds in Teamcity API

I am trying to get data of my builds from Teamcity and place it into a dashboard I am creating. I am getting most of the data but this thing I am missing is the timestamp of the builds. I have searched alot on internet but cant find it. In teamcity I can see the timestamp of all the builds but it is not available in the timstamp.
All suggestions are appriciated.
Thanks
You don't need to make additional calls for each build, but you need to craft how you want the response returned. There's a query string parameter called fields that lets you define what you want to bring back.
e.g. to return the start and finish data in your original call you can add &fields=build(startDate,finishDate) to your original request
/httpAuth/app/rest/buildTypes/id:##BUILD_TYPE_ID##/builds?fields=build(startDate,finishDate)
This would return something like this
<builds>
<build>
<startDate>20140202T230456+0000</startDate>
<finishDate>20140202T230518+0000</finishDate>
</build>
<build>
<startDate>20140202T224912+0000</startDate>
<finishDate>20140202T224957+0000</finishDate>
</build>
</builds>
The caveat to this is that you now have to exclusively define what you want returned. So to return all the other fields and the start / finish date, add this parameter to the query string
&fields=build(id,buildTypeId,number,status,state,branchName,defaultBranch,href,webUrl,buildTypeId,startDate,finishDate)
TeamCity documentation - Full and Partial responses
Hope this helps
After you GET /app/rest/builds?locator=buildType:..., you need to get the detailed data of all the individual build runs you're interested in. That, unfortunately, means an extra REST call for every individual build.
The URL for each build will be in the form /app/rest/builds/id:21966, but don't hard-code this in your program. Instead, as you loop through all the builds (returned by your first call), take each build's href attribute and GET that.
To summarise:
* GET /app/rest/builds?locator=buildType:... once
* for each build in the returned data set, take its href and make another REST call
* for each returned build detail, the timestamps are in the following sub-elements: queuedDate, startDate, finishDate, triggered
We've tried implementing a dashboard this way before but found it unacceptably slow (too many REST calls). There is an alternative, which is to write a TC plugin (use the native OpenAPI): that will be much faster but of course it's more work.

CRM get stage Required Fields

In Plug or workflow
How to get stage IDs or Names dynamically from entity
How to get current stage Required fields Names dynamically not hard coded Using c# or js or any other method
if any idea, Share please!
You can get an entity's metadata from CRM by issueing a RetrieveEntityRequest. In the response you get an EntityMetadata object having an Attributes collection providing all attribute details you need.
The CRM SDK contains clear example code on this topic. More information about working with attribute metadata can be found on MSDN.
I guess you are talking about the client functions to query the Business Process Flow attributes?
In CRM 2015 there is now clientside functionality implemented to the retrieve process, stage and step information.
With Xrm.Page.data.process.getActiveProcess() you can get the current workflow process and retrieve a Process object.
You can use the following methods to retrieve further and deeper information about the process:
Process:
string: .getId();
string: .getName();
stage[]:.getStages();
bool:.isRendered();
Stage :
string:.getId();
string: .getName();
int: .getCategory().getValue();| stage category Optionset
string: .getStatus(); | „active“ , „inctactive“
step[]:.getSteps();
bool:.isRendered();
Step (the attributes):
string: .getAttribute(); | logical attribute name
string: .getName();
stage[]:.getStages();
This works in CRM 2015 but not in CRM 2013.
You find further information here:
https://technet.microsoft.com/de-de/library/dn531164.aspx

SharePoint Workflow Error: "Unable to transform the input lookup data into the requested type" BUT only on New Item Creation

FYI to start, I am aware of how to properly set up an update to a lookup, and am 99% positive I've done this correctly.
I know this because When I set the workflow to automatically start when an Item is Changed, then it works perfectly. But when I simply change this setting so it will automatically start on New Item Creation, it Cancels the workflow and I get a "Coercion Failed: Unable to transform the input lookup data into the requested type." If both options are checked then it fails on creation, but simply clicking edit on the item properties, and the "Save" makes it work.
The workflow is on a Document Library and works as follows;
User selects the Work Task LookUp from a dropdown in the edit properties form after uploading, and then Saves the item (adding it to the document library). The workflow is suppose to then look at the Work Task LookUp selected, and pull the Account and Effective Date-Type lookUp ID's that Work Task item has, and sets the Document's identical fields to the same value.
Here is the code for the workflow if it helps;
If Current Item: Parent Task is not empty
If Current Item: Sub Task is not empty
Log Both are empty to workflow history list
Then Set Account to Work Tasks:Account
The Log Set Account to workflow history list
Then Set Effective Date and Type to WorkTasks: Effective Date and Type
The Log Set EffDateType to the workflow history list
This is all done in one step. I also added additional steps to test if the account and effective date type fields have been set properly, and if not to set them again. But everytime I run the workflow on change and it works, it always correctly sets these fields based upon the first Step (posted above) and the additional check logs to the history that they are not needed.
As an example, The lookUp for Integer for Tasks:Account is set to work as follows;
Date Source: Work Tasks (a list)
Field from Source: Account (a lookup)
Return Field as: Lookup ID (as Integer)
Find the List Item
Field: Title (from the Work Tasks list)
Value: Current Item: Parent Task (Which is a look up of the "Title"
Field from Work Tasks List, and is set to return the Value as a LookUp Value (As Text))
The Effective Date and Type setting is pretty much identical.
So anyone have any insight? I've tried running it as an impersonated Step, setting a workflow pause (for 1 minute), changing the lookup types incase I messed it up to start with, but ultimately the above workflow DOES work, but only when I set it to "Automatically start on the Change (edit) of an Item", NOT "Automatically start on New Item Creation" like I need to to do.
Oh yes, fyi, I am using SPServices CascadingDropDown on the Work Task and Sub Task fields of the doc Library form, but I honestly do not believe this has anything to do with my issue.
UPDATE:
I've talked with another developer, and he believes it is due to the issue that the workflow is occuring too quickly, before the item creates an ID for itself, which it needs to conduct the lookUps. He had me add another "Pause Workflow" to the very top of my workflow code (above the If conditions) and set it for 1 minute.
It then worked properly.
Downside is we want this to labeling to occur as close to item creation as possible. Because a view of the library relies on grouping based upon Account and Effective Date and Type. To add to this downer, Microsoft's Pause Workflow only allows for 1 minute or more, and then the timer used for this is often off, resulting in a pause longer than that. So far, every test is currently showing 2 minutes minimum on the pause.
A possible alternative solution for instantaniously populate the fileds is to use Javascript and SPServices to do the lookUp to the Task list to pull the account and effective date - type fields and then populate, but my Javascript is not very strong and I would need help doing this. If anyone has any suggestions, I would appreciate them.
(Answered in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
I don't know if it is the ID for the item after further testing. I changed the start of the workflow to wait until a field in the item changes. I set it to wait until the ID field is not 0 (since you cannot set to null), and it still does not work.
6/14/2012 4:13 PM Comment System Account Waiting on ID ​
6/14/2012 4:13 PM Comment System Account Waiting complete on ID ​
6/14/2012 4:13 PM Error System Account Coercion Failed: Unable to transform the input lookup data into the requested type.
I have tried other fields as well, like document ID value is not empty, and it will wait, log it finishing the wait, and then fail.
UPDATE This issue has something to do with the Parent Task field. I have solved the issue without having to wait for a period of time by setting the change from above to wait until the Parent Task field is not empty. It then completes the workflow fine.
Anyone know why there is a delay though? I've solved it, but still don't fully understand what takes it so long.
The main fault has been solved (hence the answer), and the remaining point about the reasons for the delay would probably be a discussion point or not specific enough for SO. Any further clarification can be edited in here.