How to get the email/name of the user that initiates a Jira Webhook - jira

I'm working on a internal integration with Jira and I need to perform an action when a ticket is moved between boards. I've setup a Automation trigger that sends a web requeest but I'm not sure how to get the name of the user that performs the action.
Although Atlassian's docs are all over the place, I found out that there is an action object that is passed but nothing more.

Related

Asana Webhooks API

So I have implemented the Asana Webhooks API as described in their documents. I can pass it a project ID and request a new webhook be created. The API successfully sends a authentication request to my application which returns the Security header as described in the Docs. Asana then returns the expected success response, outlining the newly created Webhooks unique ID.
Now if i take this ID and then query the Asana API to show me all configured webhook's on either the parent Workspace or the project resource directly it returns an empty data JSON Object or reports the resource doesn't exist, suggesting the Webhook Ive just created wasn't actually created, despite giving me the expected success response.
Also If I then make a change to a project it doesn't fire the webhook and I don't receive any events on my application.
Strangely everything was working on Friday but today (Monday) I'm experiencing these issues.
Any pointers would be good, Ive been working as the Docs suggest in terms of my request structure and am authenticating using a PAT, Ive even tried a newly created token.
Thanks,
Our webhooks use the handshake mechanism to make sure that it's possible to call you back, but there's always the possibility that subsequent requests can fail. Additionally (although we don't document this very well - there's an opportunity for us) we should immediately try to deliver a (probably) empty event after the handshake (it looks like {"events":[]}. This is kind of like a "second callback" that contains anything that has changed since you created the webhook.
If this fails - or if any subsequent request fails often enough - the webhook will get trashed. "Failure" in this context means returns HTTP response codes other that 200 or 204.
As for why you're having trouble querying the webhook itself, I wasn't able to repro the issue, so we'd have to dive deeper. It should be fine if you:
Specify the workspace
Optionally specify the resource
I tested this out, and it seemed fine. You also might want to directly query the webhook by id with the /webhooks/:id endpoint - note to use the id of the webhook returned by create, and not the id in the resource field.
If you created the webhook (specifically, your PAT or OAuth app was the one making the create request) you should see the information just fine. If you can get the webhook by id, you should see last_failure_at and last_failure_content fields which would tell you why the webhook was unable to make the delivery.
Finally, if you would like to contact us at api-support#asana.com and let them know more details (for instance, the ID of the webhook you're trying to look at) we can look at those fields from our side to see if we can identify what's going on.

Upsource Webhooks and JIRA

I am working on automating the code review process in my team.
My objectives are:
When a review is created, assign it to two random developers
Automatically update the JIRA item, and assign them to the developers who were assigned as reviewers in Upsource
I was able to achieve objective #1 using Upsource Custom Workflows.
For the second objective, I have tried looking at Upsource Webhooks and JIRA Cloud REST API, but I fail to see how to assign a JIRA item from Upsource. JIRA's API specifies that in order to assign an item using REST, we need to create PUT request to this method:
PUT /rest/api/2/issue/{issueIdOrKey}/assignee
How can I create a PUT request from Upsource Webhooks?
How can I extract the {issueIDOrKey} from the originating Upsource review?
How can I create a PUT request from Upsource Webhooks?
Upsource webhooks send only POST requests at the moment. But I don't see how this limitation is blocking your task, because as I understand there has to be a service that'll translate Upsource payload to JIRA payload. That service should make a PUT request.
How can I extract the {issueIDOrKey} from the originating Upsource review?
Upsource provides an API for this. getReviewDetails method allows to get a list of issues associated with a given review (see this message spec).

user notifications in Grails

I'm building an application using Grails 2.5.1 , i want to implement a user's notification service ,similar as Stack overflow for instance when the user has unread messages it notifies the user as soon as he login . is there a plugin or a handy way to achieve this ?
thanks
If you want some data (ex: unread messages) on demand (login), then you could include this in the action's returned map or fetch the data from a separate Ajax call when the document.event fires and manipulate the DOM (easily done through jquery, angular, etc.)
If you are looking to update the DOM asynchronously based on events that happen server-side (another user sends a message and you would like to 'instantly' alert the current user), then things become more complicated.
Spring Websocket
There is a grails plugin that we have experimented with and have had success with: grails-spring-websocket. Check out the link for examples and more info.
There is a bean brokerMessagingTemplate that is injected within your service class that has methods to publish a message. On the client, you subscribe to the corresponding message url using javascript. When the callback function is executed, a message has been published - manipulate the DOM as needed.
There are also some controller annotations provided by the plugin, but I don't have experience with them.

Can a desire2learn remote plugin be used to insert a custom external learning tool link into a course module?

We'd like to use a Desire2Learn remote plugin to configure a custom LTI external learning tool link via the course builder, but it's not clear to me if and how the remote plugin API is supposed to be used to achieve this.
This is what we'd like to do:
When the user adds an instance of our remote plugin to a module using the Course Builder, our plugin will display a UI to configure a specific instance of our LTI tool. When the instructor has finished configuring the instance through our plugin UI, we'd like an External Learning Tool link to be created at the location in the module where the plugin was dropped. Then when the student clicks on the module link they will see the external learning tool rather than the plugin UI.
It's possible we might be able to use the Valence API to create the link when our Plugin UI is executed in a similar way to how the Book Widget example (http://devs.valence.desire2learn.com/2013/02/15/remote-plugins-the-bookwidget-sample-2) adds books to the course. However, I'm not sure how we would know exactly where to create the link or if it is even possible to create LTI external tool links using the Valence API.
Also, when you use a plugin in the course builder you can drag the plugin to a specific location in the module e.g. between 2 existing items. I don't see anything in the LTI launch parameters when the plugin is executed that tells us where that is apart from this parameter:
custom_links_import_service_url:_https://mydomain.desire2learndemo.com/d2l/lms/remoteplugins/coursebuilder/ImportService.d2l?parentNode=541&pluginId=85834c62-3fc6-455d-b89a-e99bbf70f1ce
That URL has the node of the module (parentNode=541) but doesn't tell us where in the module the plugin was placed.
The launch also includes a return URL parameter but returning to that just seems to refresh the page, and not even the original plugin launch url is added to the module.
I see the text "Insert action was cancelled." at the top of the popup and the course builder refreshes.
launch_presentation_return_url:_https://mydomain.desire2learndemo.com/d2l/lms/remoteplugins/courseBuilder/return.d2l?ou=6671&parentNode=541&pluginId=85834c62-3fc6-455d-b89a-e99bbf70f1ce
Hope this description of what we'd like to do makes sense, and thanks for any insights on how we can do this.
There are several aspects to this question.
Creating LTI links through the API. We currently don't support creation of LTI links through the Learning Framework APIs, but that is on the roadmap for our upcoming 10.2 release due for Spring 2013. The upcoming APIs will let callers register new LTI Link objects, and also fashion a Quicklink around a registered LTI Link (which then contains a URL that can be used to launch the LTI Link).
Positioning content topics within course content modules. Currently our API only supports the creation, modification, or removal of topics from within a module; we don't provide an API to precisely position a topic within a module's list of contained topics. New items placed within a module always get placed at the bottom of the list of things that module contains. The parentNode value you get passed is indeed the ID of the parent content module, and when you use an API to add a topic, you'd add it to that module.
Page return. The current behaviour of the D2L LE Tool Consumer is that when the Tool Provider redirects to the launch_presentation_return_url, the LMS refreshes the page (thus, any links you inserted before redirecting to the return URL appear in the refreshed page). If you need to direct the user's attention to anything about the status of the LTI launch, then your UX needs to handle that messaging to the user before redirecting back to the return URL.
On deployed versions of the LMS up to March 2013, on page return LTI Tool Providers need to send the ?lt_msg= query string parameter along with the return URL, although it's OK for this parameter to have an empty value. After the service packs provided in March 2013, Tool providers no longer need to send back that query parameter to the return URL: any request of the return URL will require a page refresh whether or not it includes the query parameter.

Setup TFS/Test Manager to send email on test failure

Is it possible to setup TFS/Test Manager so that it sends out an email after a test fails?
Yes, it is possible but it requires quite a lot of changes/additions to the process template and possibly a custom-made activity.
After tests have run, we check if BuildDetail.BuildPhaseStatus has status failed
We send mail to everyone who has changesets committed to this build, so the build goes through BuildDetail.AssociatedChangesets (you need to have AssociateChangesetsAndWorkItems on) and get the committer username.
Unfortunately for us, there's no good correlation between TFS username and email address at our place, so we had to create a custom activity that looks that up in the AD.
The actual email is sent with the BuildReport action from Community TFS Build Extensions. We modified the xslt, but that's not really necessary. We also wanted to include a listing of the failed tests, and that required modification of the action itself (test data isn't included by default).
Looking at this description and all the work made to get this working, I'm beginning to wonder if it was worth it ;).

Resources