How should I react in the following situation? It happens to me regularly. Just for context: I used to be a hard-worker, but frequently I did not get enough recognition for my work, so I'm trying to be smarter now.
I'm sitting in a work meeting, a normal discussion on some aspect of the project, not a steering committee or anything similar: 5-7 people, half of them on my grade, the rest senior to us, our boss and their peers.
Example 1: Then "Peter" (from my grade) says something like: "I'm facing this and that problem and I'm not sure how to deal with it". The rest can't help. I can. I say something like: "We've been facing something similar in my team lately and if you wish I can share the code that solved the problem and share the info I got from Team A and B about the root cause". Peter says in front of our boss: "Thanks, but I have some ideas and will be able to do that on my own".
Example 2: Then "Peter" says: "Who should pick up Task A?". I reply something similar to: "Do you want to be responsible for that? If that's the case, that's ok for me. Otherwise, I will take this" or the other way round: "I will take it unless you want to be responsible". Peter's reply in front of our boss: "I will do that".
Then, a few minutes or an hour after the meeting, in both the versions of the situation Peter comes back to me and says: "Sorry, I changed my mind. Could you do that/ help me?".
It's normally an effort of at least several hours. I feel bad if I say no, but I feel manipulated if I say yes. The management will think Peter did that (on his own) and if I mention it was actually me, I will be seen as not a team player.
I'm all for giving favors and being nice to everybody. However, these people are normally "takers" - they expect a lot from you and don't hesitate to ask you something, but you can't rely on them to return the favor. They themselves say: "That's not my job" quite a bit. This explains why I think about my interests in the situation presented here.
What's the best way to go here?