You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a custom needservice that mines JIRA tickets and writes data to each requirement need.
I have a dynamic function that manipulates data of the 'components' option of each requirement need and updates the need 'in place'.
This ensures that the data for needs has been processed inside conf.py and is not reliant on any dynamic functions called from directives inside rst within the document.
The requirement needs generated by the needservice are unavailable in each need variable. I have other requirements not generated by needservice and these are available in each need variable.
So the workaround is to use the needs variable in the dynamic function. I can then loop over each need of the needs variable.
The problem with this is that the dynamic function is called for every need type in the filter, so it executes multiple times. I have to put in extra code to restrict the function to only execute once.
This works, but it's ugly for 2 reasons. Firsty the execute once restriction, secondly I am using needs_global_options to return values to the 'components' option, but I am not returning anything and updating the need in place.
Is there a reason why needservice needs are not available in each need variable inside dynamic functions, but other needs are?
Is there some way to ensure that a dynamic function gets called just once, not for every need?
Thanks
The text was updated successfully, but these errors were encountered:
jumbo172
changed the title
Dynamic function
Dynamic function cannot access needservice need types
Jul 4, 2024
I have a custom
needservice
that mines JIRA tickets and writes data to eachrequirement
need.I have a dynamic function that manipulates data of the 'components' option of each
requirement
need and updates the need 'in place'.This ensures that the data for needs has been processed inside conf.py and is not reliant on any dynamic functions called from directives inside rst within the document.
The dynamic function is called like this:
And is registered like this:
The issue is that when the dynamic function is called using global options:
The
requirement
needs generated by the needservice are unavailable in each need variable. I have other requirements not generated by needservice and these are available in each need variable.So the workaround is to use the
needs
variable in the dynamic function. I can then loop over eachneed
of theneeds
variable.The problem with this is that the dynamic function is called for every need type in the filter, so it executes multiple times. I have to put in extra code to restrict the function to only execute once.
This works, but it's ugly for 2 reasons. Firsty the execute once restriction, secondly I am using
needs_global_options
to return values to the 'components' option, but I am not returning anything and updating the need in place.Is there a reason why
needservice
needs are not available in each need variable inside dynamic functions, but other needs are?Is there some way to ensure that a dynamic function gets called just once, not for every need?
Thanks
The text was updated successfully, but these errors were encountered: