Get User who provisioned / called upsertSeedObjs in an afterCreate for SeedData

In an afterCreate for an entity type that mixes SeedData, I’m hoping to access the current user who “created” the data, which we’re defining as the user who a) performed provisioning, or b) the user who called upsertSeedObjs for the specific data. Within the afterCreate function in both cases, I’m finding that c3Context().username is always provisioner, which I expected for provisioning, but not necessarily for creation through upsertSeedObjs.

a) When provisioning, is there a way to access the user who provisioned? I see TagProvisionLog.fetch() provides an author, but can that username be fetched from somewhere during the provisioning process itself?

b) Similarly, when calling upsertSeedObjs, is there a way to access the user who made the call from console rather than getting provisioner (or is this a bug)?

username provisioner is by design. You can get username from TagProvisionLog.meta.updatedBy to see who did that provisioning.

@pavan.nandikonda thank you, but I’m finding that the TagProvisionLog object isn’t created until provisioning has finished. Would there be a way to get this info mid-provision (during that first afterCreate)?

And is there a similar strategy I could use during an upsertSeedObjs call?

if you are trying to get this at the time of provisioning afterCreate call of whihc Type data. if the user is not doing upsertSeedobjs of that type, then you won’t get this info.
Rightnow, data is upserted as “provisioner” when doing Tag deployment ( i.e c3-prov or tag.deploy or TagMetadataStoreupsertSeedObjs)