I'll illustrate with an example: I have a chemist lvl. 6 whose second ability is 'Black Magic'. When this chemist during battle uses black magic spells, are these job points earned for the chemist job or for the wizard?
You gain JP (Job Points) for the Class you currently are.
So a Wizard that has White Magic as its secondary skillset will only gain JP as a Wizard.
Party members under some circumstances spill their gained JP over to other members of the party. Dead/KO allies do not gain JP-Spillover (only tested in wotl).
So let's say there is a party (in battle) of a Monk, Archer, and Knight. You will notice over time that the Monk will gain (a small amount) of JP in Archer and Knight overtime in addition to his gained Monk JP. (This happens for the Archer and Knight respectively).
Pretty certain this works for jobs not yet unlocked and explains why some characters start with a nice amount of JP after unlocking the class (This part is just from memory and speculation though).
FFT Original - 25% of JP gained is spilt-over to allies. More info here.
FFT: War of the Lions - 25% of JP gained is spilt-over to allies. More info here (This might actually be 33%, I'm finding mixed sources on this but this is doubtful).
Gained JP Up - This skill does not increase the amount allies gain from spillover. Only the person with the ability equipped (Which explains why it always seems a lot less to me haha). Additionally if the character gaining spillover experience has Gained JP Up it still doesn't affect the JP gained. Gained JP Up only works strictly when they are the direct receiver of the JP and it is applied after spillover happens.
For the formula of JP gain in general, we can refer to the Battle Mechanics Guide:
JOB POINTS ---------- JP are doled out according to this equation: JP = [(8 + (JobLevel * 2) + [Lv / 4]) * M] where JobLevel is caster's level at their current job (can range from 1 - 8) Lv is the level of the person performing the action M is 3/2 if the caster has 'Gained JP-UP' 1 otherwise JP SHARING When unit X gains JP, everyone else in the party will earn [gained JP / 4] towards the job which unit X currently has. Note: if unit X has 'Gained JP-UP', the extra JP given by that ability are ignored in the JP sharing equation. Monsters do not receive JP.
In @Shelby115's answer, there are a few details about spillover JP that are off.
First, units gain spillover JP even when they haven't unlocked the class. You just won't be able to access it until the class is unlocked, but it will be waiting there when you do.
Second, spillover JP is 25% of base in both the original and the PSP version of the game. The source for WotL is wrong, and the iOS version didn't exist when that source was written, so I'd say the iOS version is probably also 25%.
From Qu_Marsh's FAQ:
Whenever a character gains JP, all other allies ALSO gain some JP for the same job, equal to 25% of the JP earned by the original character. For example, if a character on your team who's a Ninja performs an action and gains 40 JP, your other units will also gain 10 JP for the Ninja job, regardless of what their current job is.
But this is an FAQ adapted from an FAQ from the Western PSX version of the game, so it might assume by default that things were the same. The best way to check is for someone to test it out instead of relying on sources which might be passing on misinformation.
I had asked someone to test it out on their PSP (WotL version) after seeing this question.
- Test 1: The acting unit (without JP boost) gained 33 JP while the other party members gained 8 JP in the same class. This is consistent with 1/4th (rounded down) of the base gain.
- Test 2: The acting unit (with JP Boost) gained 34 JP, while party members gained 5JP. This is consistent with 23 JP base (where square brackets mean truncation):
[23/4] = 5, and
[23*3/2] = 34.