Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report fields not available for output reports filename #350

Open
felix-caboff opened this issue Oct 12, 2023 · 4 comments
Open

Report fields not available for output reports filename #350

felix-caboff opened this issue Oct 12, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@felix-caboff
Copy link

Is your feature request related to a problem? Please describe.
I am required to format the filename of the output reports in a particular way and this includes the project name. At the moment this field is not available. Instead only the following are:

image

Describe the solution you'd like
It would be ideal if all the variables that are available in the report are also available in the filename within the global report options. This gives the greatest level of flexibility. There may also be mileage is attempting to rationalise the naming convention too.

@chrismaddalena
Copy link
Collaborator

Hey @felix-caboff, the project name displayed by Ghostwriter is the client name + the assessment type so you can assemble that in the report title configuration. Do you mean you want to include the codename?

When you say you want all variables available, do you mean the values under the project key available in the templates?

image

@felix-caboff
Copy link
Author

Yes please on the whole of the project key.

@er4z0r
Copy link

er4z0r commented Nov 7, 2023

I second @felix-caboff. Having access to the reporting context when constructing the filename would be very helpful.

One thing I have wondered though is whether it would be better located with the template (if only as an optional field that can be used to override the global) as opposed to the overall installation. In the end the filename is something that mostly affects the report as a final product so one could argue that the structure of the filename would better be placed with the other information that shapes the report (i.e., the template).

Let me give you one more peculiar example where this has become relevant to us:

  • we've recently rebranded as a company so in theory I should change all the attributes for{{company}}
  • unfortunately there are still some client's that need their to get their reports in the old branding until end of year
  • So if I change company to the new one, it messes up the old filenames. If I leave it as is it messes up the new reports.
  • If the pattern for the filename were located with the report template, I could set the filename for the old report template to be "report_something_oldname" and in the new template use "report_something_newname"

Actually this has given me an even wilder idea: having the ability to overwrite system globals in the template (e.g. redefining variables per template) might be a rather handy feature.

Sorry, for hijacking your issue @felix-caboff . It felt on topic :)

@chrismaddalena
Copy link
Collaborator

@er4z0r That's something that may be possible with via the new custom fields feature coming in v4.1 (See PR #346). We're looking at reports now, but we could potentially extend custom fields to templates too. Then a check like "if a field named report_filename exists, use that instead of the global value" could be a thing.

Allowing global options to be overridden by templates has been in the backlog for a long time.

I don't know if all report context can be made accessible as a filename, especially once custom fields are in the mix, but we'll see about expanding what is available. Many of the values from the project key are very doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

3 participants