Skip to content

Conversation

@abujeda
Copy link
Contributor

@abujeda abujeda commented Dec 2, 2025

Fixes to the Request Tracker and ServiceNow backend implementation for Support Ticket functionality.

The fixes are for the template lookup to that is used to generate the content with the job/session info and sent to the remote system. Now it is using Rails lookup respecting views locations and overrides for the template lookup.

Before it was using only the view folder under the main Rails.root directory

@abujeda abujeda force-pushed the support_ticket_template_override branch from adebe2f to a68afbb Compare December 3, 2025 10:13
@johrstrom johrstrom closed this Dec 4, 2025
@github-project-automation github-project-automation bot moved this from Awaiting Review to Merged/Closed in PR Review Pipeline Dec 4, 2025
@johrstrom johrstrom reopened this Dec 4, 2025
@github-project-automation github-project-automation bot moved this from Merged/Closed to Awaiting Review in PR Review Pipeline Dec 4, 2025
@johrstrom
Copy link
Contributor

Sorry for the delay, I'll get to this shortly.

@johrstrom
Copy link
Contributor

Sorry for the delay, I'll get to this shortly.

Still need to carve out time and refresh my memory on this. These do not appear to be ActiveModels, but my first instinct is to mention implementing to_partial_path (or partial_path?), though I don't know if that actually solves the problem of providing new views/templates.

@abujeda
Copy link
Contributor Author

abujeda commented Dec 5, 2025

Not sure I follow, but the main problem is the lookup of the template given a template path.
This is a way of using Rails mechanism to look for the templates in all the configured locations, including the override template location.

@johrstrom
Copy link
Contributor

Not sure I follow

Rails docs appear to be down, but you can call render on an object if that object responds to to_partial_path.

<%= render @motd if @motd %>

as these objects do

def to_partial_path
'dashboard/motd_osc'
end

But again, I don't know if that fits here as these are using views, but do are not actually rendering HTML for a page through a controller.

@abujeda
Copy link
Contributor Author

abujeda commented Dec 5, 2025

<%= render @motd if @motd %>

This render helper method available in the Rails template rendering context. It is the equivalent (if not the same) as
ApplicationController.render that I am using in these service classes.

As these are service classes that are not part of the rendering process, using the template based approach does not work. This is why I am rendering the template this way. I added the templates into the views folder to make it easier to locate and understand when looking at the code, but they are not use to render an HTML page in the application. They are used to generate the main content for the support ticket system API request payload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

3 participants