4 ms·
An example from the software world: Back in the misty days of Not Too Long Ago, there was a Jira add-on called nFeed. It allowed you to hook external databases
by msla 4y ago
An example from the software world:
Back in the misty days of Not Too Long Ago, there was a Jira add-on called nFeed. It allowed you to hook external databases to Jira using SQL queries and display the query results for users. Note I said display but not search for, which became a sticking point: The nontechnical users could see all the data from the Microsoft CRM internal database (and getting data out of that was another saga, but not quite of this kind) but not search for it using normal Jira search functions.
(Before I go on, I'll state that nFeed is now Elements Connect, which supports this use case natively. Basic search is a "use case" which must be explicitly "supported" because Jira.)
This was intolerable. This was not something you could fix from within nFeed. This was something I had to fix.
Fortunately, I had an Idea.
The Idea: I could create shadow fields to mirror the contents of the nFeed fields, such that those fields would be normal Jira text fields which Jira could search. I just needed a way to automatically synchronize the nFeed fields and the text fields, and a way to hide those shadow fields from the nontechnical users.
The System D stuff: nFeed used the Velocity template engine to allow you to generate the HTML to display in the Jira tickets. Velocity didn't know HTML, CSS, or JavaScript from Sweet Fanny Adams. Therefore, I could inject all three of those things directly into the ticket using the templates. I used JavaScript to read the text field from the displayed page, compare it to the text from the fresh SQL query, and, if they didn't match, use XMLHttpRequest to update the backend using the published REST API, which succeeded because it ran in the security context of the user viewing the page. A bit of inline CSS to hide the shadow text fields as long as they were beneath their corresponding nFeed field on the page and I was done.
Mostly done. I still had to ensure I wrote the JavaScript without curly brackets, as those were sacred to Velocity, and I fought with correct text quoting and unquoting for a little bit. Something I couldn't fix was Jira's own logging functionality: Every time a user with permissions to edit a ticket viewed it, the JavaScript might trigger and Jira would record that as them editing the ticket. That got me some confused support calls, but it was still better than what I would have gotten had I thrown up my hands. After all, I was the one who suggested nFeed to begin with.
Pretty good for something I cooked up the day I found the original problem, in the period of time between finding the problem and reporting it all to my manager.
- throwaway173738 4y agoAnother example: I was working as a service tech for a hardware company. We had an order come in for 1200 off something that needed to ship in 4 days. The rub was that the firmware needed to be updated over RS232, and it only supported COM1. We realized if we did one at a time we wouldn’t have enough people to finish even 300 of them. We didn’t have any way to get ahold of the original developer in Japan. So I opened the program in a hex editor and started looking for the string COM1. When I found it I changed it to COM2, then 3, then 4 to produce 4 separate programs that we could run side by side.