Niven and Pournelle’s Footfall has a team of science fiction writers helping deal with alien contact (1985).
David Brin’s The River of Time (aka "Coexistence") has SF writers brought in to help with a weirder crisis (1981).
But I suspect there are earlier examples.
What’s the earliest example of science fiction in which science fiction writers are consulted as a part of the plot?
I suspect the earliest example is in a printed work, but if, for example, there’s a movie in which the British government calls in H. G. Wells, I’d love to know about that.
EDIT: To clarify my question’s intent.
While in the real world Isaac Asimov, L. Sprague de Camp and Robert A. Heinlein actually worked for the government during World War II I don’t think they were selected to serve during World War II because of their status as science fiction writers. At least I recall nothing from Asimov’s autobiography to suggest that being an author was involved in his selection for service in government roles.
These days, there is an organization of science fiction authors who consult with the government as authors (SIGMA Forum), but that was organized in the 1990s.